text
stringlengths 0
2.2M
|
---|
#include <iterator>
|
#include <functional>
|
#include <memory>
|
#include <type_traits>
|
#include <utility>
|
#include <vector>
|
static void useCpp14Algorithms()
|
// Use each of the function templates associated with the
|
// 'BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY' flag in a
|
// syntactically correct (and semantically meaningless) manner as a
|
// compile-time test that these templates are available.
|
{
|
// Type defined in '<functional>'
|
ASSERT(0x0F == native_std::bit_not<unsigned char>().operator()(0xF0));
|
// Function defined in '<iterator>'
|
native_std::vector<int> v;
|
(void)native_std::make_reverse_iterator(v.end());
|
// Function defined in '<iomanip>'
|
(void)native_std::quoted("\"quotes\"");
|
// Function defined in '<utility>'
|
int X(0);
|
int Y = native_std::exchange(X, 1); (void) Y;
|
{ // UDLs for <complex>
|
using namespace native_std::complex_literals;
|
native_std::complex<double> zi = 2i;
|
(void) zi;
|
native_std::complex<long double> zl = 2il;
|
(void) zl;
|
native_std::complex<float> zf = 2if;
|
(void) zf;
|
}
|
{ // UDLs for <chrono>
|
using namespace native_std::chrono_literals;
|
native_std::chrono::duration<double> d(0);
|
d = 1h;
|
d = 2min;
|
d = 3s;
|
d = 4ms;
|
d = 5ns;
|
d = 6us;
|
}
|
{ // Function defined in '<memory>'
|
native_std::unique_ptr<int> up = native_std::make_unique<int>(0);
|
}
|
{ // Functions defined in '<type_traits>'
|
bool b = native_std::is_null_pointer<int *>::value;
|
(void) b;
|
class Foo final {};
|
bool b2 = native_std::is_final<Foo>::value;
|
(void) b2;
|
}
|
}
|
#endif
|
static
|
const bool u_BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY_defined =
|
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY)
|
true;
|
#else
|
false;
|
#endif
|
// case 8
|
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS) || \
|
defined(BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS_FORCE)
|
#include <atomic>
|
static void useCpp11PreciseBitwidthAtomics()
|
// Declare variables with each of the 'typedef's associated with the
|
// 'BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS' flag as a
|
// compile-time test that these 'typedef's are available.
|
{
|
ASSERT(0 < sizeof(native_std::atomic_int8_t));
|
ASSERT(0 < sizeof(native_std::atomic_int16_t));
|
ASSERT(0 < sizeof(native_std::atomic_int32_t));
|
ASSERT(0 < sizeof(native_std::atomic_int64_t));
|
ASSERT(0 < sizeof(native_std::atomic_uint8_t));
|
ASSERT(0 < sizeof(native_std::atomic_uint16_t));
|
ASSERT(0 < sizeof(native_std::atomic_uint32_t));
|
ASSERT(0 < sizeof(native_std::atomic_uint64_t));
|
ASSERT(0 < sizeof(native_std::atomic_intptr_t));
|
ASSERT(0 < sizeof(native_std::atomic_uintptr_t));
|
}
|
#endif
|
static const bool
|
u_BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS_defined =
|
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS)
|
true;
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.