text
stringlengths
0
2.2M
}
switch (test) { case 0:
case 15: {
// --------------------------------------------------------------------
// USAGE EXAMPLE
// Extracted from component header file.
//
// Concerns:
//: 1 The usage example provided in the component header file compiles,
//: links, and runs as shown.
//
// Plan:
//: 1 Incorporate usage example from header into test driver, remove
//: leading comment characters, and replace 'assert' with 'ASSERT'.
//: (C-1)
//
// Testing:
// USAGE EXAMPLE
// --------------------------------------------------------------------
if (verbose) printf("USAGE EXAMPLE\n"
"=============\n");
} break;
case 14: {
// --------------------------------------------------------------------
// TESTING 'BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY'
//
// Concerns:
//: 1 'BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY' is defined only
//: when the native standard library provides a baseline of C++17
//: library features (any, optional, variant, string_view).
//
// Plan:
//: 1 When 'BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY' is
//: defined include the appropriate headers and use the expected
//: typenames.
//
// Testing:
// BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
// --------------------------------------------------------------------
if (verbose) printf(
"TESTING 'BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY'\n"
"=========================================================\n");
if (verbose) {
P(u_BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY_defined)
}
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY)
{
std::any x;
}
{
std::optional<int> x;
}
{
std::string_view x;
}
{
std::variant<int> x;
}
#endif
if (veryVeryVerbose) P(BSLS_PLATFORM_CMP_VERSION);
} break;
case 13: {
// --------------------------------------------------------------------
// TESTING 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_*' MACROS
//
// Concerns:
//: 1 The 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD' macro is
//: defined when the native library provides a definition for an
//: overload of the 'search' function template that accepts a
//: searcher object, and not otherwise.
//:
//: 2 The 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS' macro is
//: defined when the native library provides the definition for all
//: of the 'search' functor templates in <functional>, and not
//: otherwise.
//:
//: 3 The 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS' macro is
//: only defined when the
//: 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD' macro is also
//: defined. This is a santy check as we know that no implementation
//: exists that would defined the functors but not the algorithm.
//
// Plan:
//: 1 In namespace 'case13', define 'SearcherNull', a class that is
//: compatible with the "searcher" concept and an independent
//: definition of the 'search' overload under test.
//:
//: 2 If 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD' is set,
//: confirm that the overload exists, that it accepts the searcher
//: object, and returns the expected result.
//:
//: 3 If 'BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS' is set,
//: confirm that the three native types for searcher objects exist.