text
stringlengths 0
2.2M
|
---|
// NOTE: This is not tested in 'bsls' for dependency reasons.
|
//
|
// Concerns:
|
//: 1 'bsl::is_trivially_copyable<bslmf::Nil>' is 'true'
|
//
|
// Plan:
|
//: 1 Verify 'bsl::is_trivially_copyable<bslmf::Nil>' is 'true'
|
//
|
// Testing:
|
// CONCERN: bsl::is_trivially_copyable<bslmf::Nil>::value
|
// --------------------------------------------------------------------
|
if (verbose) printf(
|
"\nTESTING: 'bsl::is_trivially_copyable<bslmf::Nil>'"
|
"\n=================================================\n");
|
// C-1
|
ASSERT(bsl::is_trivially_copyable<bslmf::Nil>::value);
|
} break;
|
case 3: {
|
// --------------------------------------------------------------------
|
// TESTING: 'bsl::is_trivially_copyable<bsls::TimeInterval>'
|
// Ensure that 'bsl::is_trivially_copyable' meta-function is
|
// specialized correctly for 'bsls::TimeInterval'.
|
//
|
// NOTE: This is not tested in 'bsls' for dependency reasons.
|
//
|
// Concerns:
|
//: 1 'bsl::is_trivially_copyable<bsls::TimeInterval>' is 'true'
|
//
|
// Plan:
|
//: 1 Verify 'bsl::is_trivially_copyable<bsls::TimeInterval>' is 'true'
|
//
|
// Testing:
|
// CONCERN: bsl::is_trivially_copyable<bsls::TimeInterval>::value
|
// --------------------------------------------------------------------
|
if (verbose) printf(
|
"\nTESTING: 'bsl::is_trivially_copyable<bsls::TimeInterval>'"
|
"\n=========================================================\n");
|
// C-1
|
ASSERT(bsl::is_trivially_copyable<bsls::TimeInterval>::value);
|
} break;
|
case 2: {
|
// --------------------------------------------------------------------
|
// EXTENDING 'bsl::is_trivially_copyable'
|
// Ensure the 'bsl::is_trivially_copyable' meta-function returns the
|
// correct value for types explicitly specified to be trivially
|
// copyable.
|
//
|
// Concerns:
|
//: 1 The meta-function returns 'false' for normal user-defined types.
|
//:
|
//: 2 The meta-function returns 'true' for a user-defined type, if a
|
//: specialization for 'bsl::is_trivially_copyable' on that type is
|
//: defined to inherit from 'bsl::true_type'.
|
//:
|
//: 3 The meta-function returns 'true' for a user-defined type that
|
//: specifies it has the trait using the
|
//: 'BSLMF_NESTED_TRAIT_DECLARATION' macro.
|
//:
|
//: 4 For cv-qualified types, the meta-function returns 'true' if the
|
//: corresponding cv-unqualified type is trivially copyable, and
|
//: 'false' otherwise.
|
//:
|
//: 5 For array types, the meta-function returns 'true' if the array
|
//: element is trivially copyable, and 'false' otherwise.
|
//
|
// Plan:
|
//: 1 Create a set of macros that will generate an 'ASSERT' test for
|
//: all variants of a type: (C4,5)
|
//: o reference and pointer types
|
//: o all cv-qualified combinations
|
//: o arrays, of fixed and runtime bounds, and multiple dimensions
|
//:
|
//: 2 For each category of type in concerns 1-3, use the appropriate
|
//: test macro for confirm the correct result for a representative
|
//: sample of types.
|
//
|
// Testing:
|
// EXTENDING bsl::is_trivially_copyable
|
// --------------------------------------------------------------------
|
if (verbose)
|
printf("\nEXTENDING 'bsl::is_trivially_copyable'"
|
"\n======================================\n");
|
// C-1
|
ASSERT_IS_TRIVIALLY_COPYABLE_OBJECT_TYPE(UserDefinedNonTcTestType,
|
false);
|
// C-2
|
ASSERT_IS_TRIVIALLY_COPYABLE_OBJECT_TYPE(UserDefinedTcTestType, true);
|
// C-3
|
ASSERT_IS_TRIVIALLY_COPYABLE_OBJECT_TYPE(UserDefinedTcTestType2, true);
|
} break;
|
case 1: {
|
// --------------------------------------------------------------------
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.