text stringlengths 0 2.2M |
|---|
// class CopyOnlyTrivialTestType
|
// =============================
|
typedef CopyOnlyBaseTestType<TRIVIAL> CopyOnlyTrivialTestType;
|
// ================================
|
// class CopyOnlyNonTrivialTestType
|
// ================================
|
typedef CopyOnlyBaseTestType<NON_TRIVIAL> CopyOnlyNonTrivialTestType;
|
// ================================
|
// class CopyOnlyBslmaAllocTestType
|
// ================================
|
typedef CopyOnlyBaseTestType<BSLMA_ALLOC> CopyOnlyBslmaAllocTestType;
|
// ===============================
|
// class CopyOnlyArgTAllocTestType
|
// ===============================
|
typedef CopyOnlyBaseTestType<ARG_T_ALLOC> CopyOnlyArgTAllocTestType;
|
// TRAITS
|
namespace bsl {
|
template <>
|
struct is_trivially_copyable<CopyOnlyTrivialTestType> : true_type {};
|
template <>
|
struct is_trivially_copyable<CopyOnlyNonTrivialTestType> : false_type {};
|
template <>
|
struct is_trivially_copyable<CopyOnlyBslmaAllocTestType> : false_type {};
|
template <>
|
struct is_trivially_copyable<CopyOnlyArgTAllocTestType> : false_type {};
|
} // close namespace bsl
|
namespace BloombergLP {
|
namespace bslma {
|
template <>
|
struct UsesBslmaAllocator<CopyOnlyBslmaAllocTestType> : bsl::true_type {};
|
template <>
|
struct UsesBslmaAllocator<CopyOnlyArgTAllocTestType> : bsl::true_type {};
|
} // close package namespace
|
namespace bslmf {
|
template <>
|
struct UsesAllocatorArgT<CopyOnlyArgTAllocTestType> : bsl::true_type {};
|
} // close namespace bslmf
|
} // close enterprise namespace
|
//=============================================================================
|
// TEST DRIVER TEMPLATE
|
//-----------------------------------------------------------------------------
|
// ================
|
// class TestDriver
|
// ================
|
template <class TYPE>
|
struct TestDriver
|
// This template class provides a namespace for testing
|
// 'bslma::ConstructionUtil'. The template parameter 'TYPE' specifies the
|
// type to construct.
|
{
|
public:
|
// TYPES
|
enum ExpectedAllocator {
|
DEFAULT = 0,
|
OBJECT = 1,
|
SUPPLIED = 2
|
};
|
// CLASS METHODS
|
static void testCase5Imp(int expCopyInvocationsNum,
|
int expMoveInvocationsNum,
|
int expCopyAllocInvocationsNum,
|
int expMoveAllocInvocationsNum,
|
int expCopyArgTInvocationsNum,
|
int expMoveArgTInvocationsNum,
|
ExpectedAllocator expAlloc,
|
bool useAllocator
|
);
|
// Implementation of the 'testCase5Alloc' and the 'testCase5NoAlloc'.
|
static void testCase5NoAlloc(int expCopyInvocationsNum,
|
int expMoveInvocationsNum,
|
int expCopyAllocInvocationsNum,
|
int expMoveAllocInvocationsNum,
|
int expCopyArgTInvocationsNum,
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.