text
stringlengths
0
2.2M
static const bool u_BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD_defined =
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD)
true;
#else
false;
#endif
static const bool u_BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS_defined =
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS)
true;
#else
false;
#endif
// case 13
#include <algorithm> // for 'search'
#include <utility> // for 'pair'
namespace case13 {
struct SearcherNull {
native_std::pair<const char *, const char*> operator()(const char* first,
const char* last)
const;
// Return 'native_std::pair<last, last>' ("needle not found")
// irrespective of the contents of '[first, last)'. Note that the
// (default) constructor does not allow the specifiction of a "needle".
};
native_std::pair<const char *, const char*>
SearcherNull::operator()(const char *, const char *last) const
{
return native_std::make_pair(last, last);
}
template<class ForwardIterator, class Searcher>
BSLS_KEYWORD_CONSTEXPR ForwardIterator search(ForwardIterator first,
ForwardIterator last,
const Searcher& searcher)
{
return searcher(first, last).first;
}
} // close namespace case13
// case 12
namespace case12 {
// We need to portably test whether the begin/end free functions are part
// of namespace 'std' when the feature macro is NOT defined, as this will
// cause failures when BDE code provides its own alternative.
struct TestType {
typedef int * iterator;
int d_data;
int *begin() { return &d_data; }
int *end() { return &d_data; }
};
template <class CONTAINER>
typename CONTAINER::iterator begin(CONTAINER & c)
// Return 'begin()' for the specified 'c'.
{
return c.begin();
}
template <class CONTAINER>
typename CONTAINER::iterator end(CONTAINER & c)
// Return 'end()' for the specified 'c'.
{
return c.end();
}
} // close namespace case12
// case 11
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY) || \
defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY_FORCE)
#include <memory>
using Obj1 = native_std::integer_sequence<int>;
using Obj2 = native_std::index_sequence<1>;
using Obj3 = native_std::make_integer_sequence<int, 1>;
using Obj4 = native_std::make_index_sequence<1>;
using Obj5 = native_std::index_sequence_for<int>;
#endif
// case 10
#if defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY) || \
defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY_FORCE)
#include <chrono>
#include <complex>
#include <iomanip>