#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::map<int, double> C;
C::iterator ii1{}, ii2{};
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
#include "min_allocator.h"
assert(*next(m.begin()) == V(2, 1));
assert(*next(m.begin(), 2) == V(3, 1));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
V ar[] =
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less <>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().count(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().count(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().count(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().equal_range(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().equal_range(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().equal_range(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().find(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().find(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().find(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less <>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::map<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::multimap<int, double> C;
C::iterator ii1{}, ii2{};
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
assert(*next(m.begin(), 7) == V(3, 1.5));
assert(*next(m.begin(), 8) == V(3, 2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
V ar[] =
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::multimap<int, double, std::less<>> M;
typedef M::size_type R;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().count(C2Int{5});
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().count(C2Int{5});
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().count(C2Int{5});
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().equal_range(C2Int{5});
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().equal_range(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().equal_range(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().find(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().find(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
M().find(C2Int{5});
}
}
-#endif
\ No newline at end of file
+#endif
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
#include "is_transparent.h"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<const int, double> V;
typedef std::multimap<int, double, std::less<>> M;
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <map>
#include <cassert>
+#include "test_macros.h"
#include "is_transparent.h"
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
#error "This test requires is C++14 (or later)"
#else
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<int, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
assert(*i == j);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::multiset<int> C;
C::iterator ii1{}, ii2{};
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
assert(*++i == V(5));
assert(*++i == V(6));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
typedef C::value_type V;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
assert(*next(m.begin(), 7) == 3);
assert(*next(m.begin(), 8) == 3);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
V ar[] =
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::multiset<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
assert(r == 0);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<int, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
assert(r.second == next(m.begin(), 8));
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
assert(*i == j);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::set<int> C;
C::iterator ii1{}, ii2{};
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
assert(m.key_comp() == Cmp(10));
assert(m.get_allocator() == A(4));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef test_compare<std::less<int> > Cmp;
typedef test_allocator<int> A;
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "test_allocator.h"
assert(*next(m.begin()) == 2);
assert(*next(m.begin(), 2) == 3);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
V ar[] =
#include <set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
#include "private_constructor.hpp"
}
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int V;
typedef std::set<V, std::less<>> M;
#include <iterator>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(i == j);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
{
typedef std::array<int, 5> C;
#include <deque>
#include <cassert>
+#include "test_macros.h"
#include "test_allocator.h"
#include "DefaultOnly.h"
#include "min_allocator.h"
void
test2(unsigned n)
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
assert(DefaultOnly::count == 0);
void
test3(unsigned n, Allocator const &alloc = Allocator())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::deque<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
{
test<DefaultOnly, min_allocator<DefaultOnly> >(4095);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
test3<DefaultOnly, std::allocator<DefaultOnly>> (1023);
test3<int, std::allocator<int>>(1);
test3<int, min_allocator<int>> (3);
#include <iterator>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
assert(i == j);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
std::deque<int>::iterator ii1{}, ii2{};
std::deque<int>::iterator ii4 = ii1;
#include <forward_list>
#include <cassert>
+#include "test_macros.h"
#include "DefaultOnly.h"
#include "min_allocator.h"
template <class T, class Allocator>
void check_allocator(unsigned n, Allocator const &alloc = Allocator())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::forward_list<T, Allocator> C;
C d(n, alloc);
assert(d.get_allocator() == alloc);
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
C::const_iterator j;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
std::forward_list<int>::iterator ii1{}, ii2{};
std::forward_list<int>::iterator ii4 = ii1;
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
struct A
assert(j->first == 3);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
std::list<int> c;
std::list<int>::iterator ii1{}, ii2{};
#include <list>
#include <cassert>
+#include "test_macros.h"
#include "DefaultOnly.h"
#include "test_allocator.h"
#include "min_allocator.h"
void
test3(unsigned n, Allocator const &alloc = Allocator())
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::list<T, Allocator> C;
typedef typename C::const_iterator const_iterator;
{
++i;
assert(*i == 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::list<int, min_allocator<int> > C;
C l(3, min_allocator<int> ());
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
C::const_iterator j;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
std::vector<bool>::iterator ii1{}, ii2{};
std::vector<bool>::iterator ii4 = ii1;
#include <cassert>
#include <iterator>
+#include "test_macros.h"
#include "min_allocator.h"
struct A
assert(j->first == 3);
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::vector<int> C;
C::iterator ii1{}, ii2{};
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_map<int,double> C;
C::iterator ii1{}, ii2{};
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_multimap<int,double> C;
C::iterator ii1{}, ii2{};
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_allocator<std::pair<const T, T>> A;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../NotConstructible.h"
#include "../../../test_compare.h"
assert(c.key_eq() == test_compare<std::equal_to<int> >());
assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, std::string> P;
typedef test_allocator<std::pair<const int, std::string>> A;
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_multiset<int> C;
C::iterator ii1{}, ii2{};
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_hash<std::hash<T>> HF;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
#include <unordered_set>
#include <cassert>
+#include "test_macros.h"
#include "min_allocator.h"
int main()
C::const_iterator i;
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // N3644 testing
typedef std::unordered_set<int> C;
C::iterator ii1{}, ii2{};
assert(c.load_factor() == 0);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef NotConstructible T;
typedef test_hash<std::hash<T>> HF;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
#include "test_allocator.h"
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
#include <cassert>
#include <cfloat>
+#include "test_macros.h"
#include "test_iterators.h"
#include "../../../test_compare.h"
#include "../../../test_hash.h"
assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
assert(c.max_load_factor() == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef int T;
typedef test_hash<std::hash<T>> HF;
#include <experimental/optional>
+#include "test_macros.h"
+
int main()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
using std::experimental::optional;
using std::experimental::nullopt_t;
using std::experimental::nullopt;
test ( U"a", 1 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char *s = "ABC";
constexpr std::experimental::basic_string_view<char> sv( s, 2 );
test ( U"a", 1 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::experimental::basic_string_view<char> sv ( "ABC", 2 );
static_assert ( sv.length() == 2, "" );
template<typename SV>
void test1 () {
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr SV sv1;
static_assert ( sv1.size() == 0, "" );
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
+
template<typename T>
void test () {
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T sv1;
static_assert ( sv1.size() == 0, "" );
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template<typename CharT>
test ( U"" );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::experimental::basic_string_view<char, constexpr_char_traits<char>> sv1 ( "ABCDE" );
static_assert ( sv1.size() == 5, "");
test ( "QBCDE", 5 );
test ( "QBCDE", 2 );
test ( "", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char *s = "QBCDE";
constexpr std::experimental::basic_string_view<char> sv1 ( s, 2 );
test ( L"QBCDE", 5 );
test ( L"QBCDE", 2 );
test ( L"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const wchar_t *s = L"QBCDE";
constexpr std::experimental::basic_string_view<wchar_t> sv1 ( s, 2 );
test ( u"QBCDE", 5 );
test ( u"QBCDE", 2 );
test ( u"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char16_t *s = u"QBCDE";
constexpr std::experimental::basic_string_view<char16_t> sv1 ( s, 2 );
test ( U"QBCDE", 5 );
test ( U"QBCDE", 2 );
test ( U"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char32_t *s = U"QBCDE";
constexpr std::experimental::basic_string_view<char32_t> sv1 ( s, 2 );
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdeabcdeabcdeabcde"), 'c', 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'q', 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'e', 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'i', 19);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'm', 15);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdeabcdeabcdeabcde"), 'b', 16);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
test(u32string_view{U"123"});
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr string_view sv { "123", 3 };
constexpr u16string_view u16sv {u"123", 3 };
test(u32string_view{U"123"});
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr string_view sv { "123", 3 };
constexpr u16string_view u16sv {u"123", 3 };
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( test_ce (5) == 0, "" );
#endif
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce ( 5, 0 ) == 5, "" );
static_assert ( test_ce ( 5, 1 ) == 4, "" );
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce ( 5, 0 ) == 5, "" );
static_assert ( test_ce ( 5, 1 ) == 4, "" );
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::experimental::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce (2, 3) == 3, "" );
static_assert ( test_ce (5, 3) == 3, "" );
#include <experimental/string_view>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
+#include "test_macros.h"
+
+#if TEST_STD_VER > 11
// quoted is C++14 only
bool is_skipws ( const std::istream *is ) {
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <experimental/string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::experimental::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1 { "abcde", 5 };
#include <cstdio>
#include <type_traits>
+#include "test_macros.h"
+
#ifndef BUFSIZ
#error BUFSIZ not defined
#endif
#ifndef _LIBCPP_HAS_NO_STDIN
static_assert((std::is_same<decltype(std::getchar()), int>::value), "");
-#if _LIBCPP_STD_VER <= 11
+#if TEST_STD_VER <= 11
static_assert((std::is_same<decltype(std::gets(cp)), char*>::value), "");
#endif
static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
assert ( std::cbegin(c) == c.cbegin());
assert ( std::cbegin(c) != c.cend());
assert ( std::cend(c) == c.cend());
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
// initializer_list doesn't have cbegin/cend/rbegin/rend
// but std::cbegin(),etc work (b/c they're general fn templates)
// assert ( std::cbegin(c) == c.cbegin());
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
assert ( std::cbegin(c) == c.cbegin());
assert ( std::cbegin(c) != c.cend());
assert ( std::cend(c) == c.cend());
assert (*std::begin(c) == val );
assert ( std::begin(c) != c.end());
assert ( std::end(c) == c.end());
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
// initializer_list doesn't have cbegin/cend/rbegin/rend
// assert ( std::cbegin(c) == c.cbegin());
// assert ( std::cbegin(c) != c.cend());
assert (*std::begin(array) == array[0] );
assert ( std::begin(array) != std::end(array));
assert ( std::end(array) == array + Sz);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
assert ( std::cbegin(array) == array );
assert (*std::cbegin(array) == array[0] );
assert ( std::cbegin(array) != std::cend(array));
static constexpr int arrA [] { 1, 2, 3 };
test_const_array ( arrA );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr const int *b = std::cbegin(arrA);
constexpr const int *e = std::cend(arrA);
static_assert(e - b == 3, "");
#include <initializer_list>
#include <cassert>
+#include "test_macros.h"
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
struct A
}
};
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct B
{
constexpr B(std::initializer_list<int> il)
}
};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
A test1 = {3, 2, 1};
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr B test2 = {3, 2, 1};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
#include <initializer_list>
#include <cassert>
+#include "test_macros.h"
+
struct A {};
int main()
std::initializer_list<A> il;
assert(il.size() == 0);
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr std::initializer_list<A> il2;
static_assert(il2.size() == 0, "");
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
#include <initializer_list>
#include <cassert>
+#include "test_macros.h"
+
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
struct A
}
};
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct B
{
constexpr B(std::initializer_list<int> il)
}
};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
int main()
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
A test1 = {3, 2, 1};
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr B test2 = {3, 2, 1};
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
#include <sstream>
#include <cassert>
+#include "test_macros.h"
#include "count_new.hpp"
int main()
{
typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_convertible<std::streambuf*, B>::value, "");
static_assert( std::is_constructible<B, std::streambuf*>::value, "");
#endif
#include <codecvt>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
typedef std::wstring_convert<Codecvt> Myconv;
Myconv myconv(new Codecvt);
assert(myconv.converted() == 0);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_convertible<Codecvt*, Myconv>::value, "");
static_assert( std::is_constructible<Myconv, Codecvt*>::value, "");
#endif
#include <codecvt>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::codecvt_utf8<wchar_t> Codecvt;
typedef std::wstring_convert<Codecvt> Myconv;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_convertible<std::string, Myconv>::value, "");
static_assert( std::is_constructible<Myconv, std::string>::value, "");
#endif
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
#include "../cases.h"
template <class T, int x>
{
static_assert((std::is_same<decltype(std::imag(T(x))), double>::value), "");
assert(std::imag(x) == 0);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::imag(val) == 0, "");
constexpr std::complex<T> t{val, val};
{
static_assert((std::is_same<decltype(std::imag(T(x))), T>::value), "");
assert(std::imag(x) == 0);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::imag(val) == 0, "");
constexpr std::complex<T> t{val, val};
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
#include "../cases.h"
template <class T, int x>
{
static_assert((std::is_same<decltype(std::real(T(x))), double>::value), "");
assert(std::real(x) == x);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::real(val) == val, "");
constexpr std::complex<T> t{val, val};
{
static_assert((std::is_same<decltype(std::real(T(x))), T>::value), "");
assert(std::real(x) == x);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr T val {x};
static_assert(std::real(val) == val, "");
constexpr std::complex<T> t{val, val};
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr std::complex<T> c1;
static_assert(c1.real() == 0, "");
static_assert(c1.imag() == 0, "");
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr std::complex<T> rhs(1.5, -2.5);
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr T rhs(-2.5);
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr std::complex<T> rhs(1.5, -2.5);
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::complex<T> lhs(1.5, 2.5);
constexpr T rhs(-2.5);
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T lhs(-2.5);
constexpr std::complex<T> rhs(1.5, 2.5);
#include <complex>
#include <cassert>
+#include "test_macros.h"
+
template <class T>
void
test_constexpr()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T lhs(-2.5);
constexpr std::complex<T> rhs(1.5, 2.5);
test ( U"a", 1 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char *s = "ABC";
constexpr std::basic_string_view<char> sv( s, 2 );
test ( U"a", 1 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::basic_string_view<char> sv ( "ABC", 2 );
static_assert ( sv.length() == 2, "" );
template<typename SV>
void test1 () {
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr SV sv1;
static_assert ( sv1.size() == 0, "" );
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), true, true);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false, false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), "abcdefghijklmnopqrst", false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdefghijklmnopqrst"), S("abcdefghijklmnopqrst"), false);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
+
template<typename T>
void test () {
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T sv1;
static_assert ( sv1.size() == 0, "" );
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template<typename CharT>
test ( U"" );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::basic_string_view<char, constexpr_char_traits<char>> sv1 ( "ABCDE" );
static_assert ( sv1.size() == 5, "");
test ( "QBCDE", 5 );
test ( "QBCDE", 2 );
test ( "", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char *s = "QBCDE";
constexpr std::basic_string_view<char> sv1 ( s, 2 );
test ( L"QBCDE", 5 );
test ( L"QBCDE", 2 );
test ( L"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const wchar_t *s = L"QBCDE";
constexpr std::basic_string_view<wchar_t> sv1 ( s, 2 );
test ( u"QBCDE", 5 );
test ( u"QBCDE", 2 );
test ( u"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char16_t *s = u"QBCDE";
constexpr std::basic_string_view<char16_t> sv1 ( s, 2 );
test ( U"QBCDE", 5 );
test ( U"QBCDE", 2 );
test ( U"", 0 );
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr const char32_t *s = U"QBCDE";
constexpr std::basic_string_view<char32_t> sv1 ( s, 2 );
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdeabcdeabcdeabcde"), 'c', 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'q', 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'e', 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'i', 19);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("laenfsbridchgotmkqpj"), 'm', 15);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test(S("abcdeabcdeabcdeabcde"), 'b', 16);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test3<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
template <class S>
test1<S>();
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
test(u32string_view{U"123"});
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr string_view sv { "123", 3 };
constexpr u16string_view u16sv {u"123", 3 };
test(u32string_view{U"123"});
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr string_view sv { "123", 3 };
constexpr u16string_view u16sv {u"123", 3 };
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( test_ce (5) == 0, "" );
#endif
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce ( 5, 0 ) == 5, "" );
static_assert ( test_ce ( 5, 1 ) == 4, "" );
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce ( 5, 0 ) == 5, "" );
static_assert ( test_ce ( 5, 1 ) == 4, "" );
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
constexpr size_t test_ce ( size_t n, size_t k ) {
typedef std::basic_string_view<char> SV;
SV sv1{ "ABCDEFGHIJKL", n };
test ( U"", 0 );
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static_assert ( test_ce (2, 3) == 3, "" );
static_assert ( test_ce (5, 3) == 3, "" );
#include <string_view>
#include <cassert>
-#if _LIBCPP_STD_VER > 11
+#include "test_macros.h"
+
+#if TEST_STD_VER > 11
// quoted is C++14 only
bool is_skipws ( const std::istream *is ) {
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
}
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1;
#include <string_view>
#include <cassert>
+#include "test_macros.h"
#include "constexpr_char_traits.hpp"
int sign ( int x ) { return x > 0 ? 1 : ( x < 0 ? -1 : 0 ); }
test(U"abcdefghijklmnopqrst", U"abcdefghijklmnopqrst", 0);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::basic_string_view<char, constexpr_char_traits<char>> SV;
constexpr SV sv1 { "abcde", 5 };
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::divides<int> F;
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(36, 4) == 9);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::divides<> F2;
const F2 f2 = F2();
assert(f2(36, 4) == 9);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::minus<int> F;
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(3, 2) == 1);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::minus<> F2;
const F2 f2 = F2();
assert(f2(3,2) == 1);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::modulus<int> F;
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(36, 8) == 4);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::modulus<> F2;
const F2 f2 = F2();
assert(f2(36, 8) == 4);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::multiplies<int> F;
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(3, 2) == 6);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::multiplies<> F2;
const F2 f2 = F2();
assert(f2(3,2) == 6);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::negate<int> F;
static_assert((std::is_same<F::argument_type, int>::value), "" );
static_assert((std::is_same<F::result_type, int>::value), "" );
assert(f(36) == -36);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::negate<> F2;
const F2 f2 = F2();
assert(f2(36) == -36);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::plus<int> F;
static_assert((std::is_same<int, F::second_argument_type>::value), "" );
static_assert((std::is_same<int, F::result_type>::value), "" );
assert(f(3, 2) == 5);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::plus<> F2;
const F2 f2 = F2();
assert(f2(3,2) == 5);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::bit_and<int> F;
assert(f(0x58D3, 0xEA95) == 0x4891);
assert(f(0x58D3, 0) == 0);
assert(f(0xFFFF, 0x58D3) == 0x58D3);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::bit_and<> F2;
const F2 f2 = F2();
assert(f2(0xEA95, 0xEA95) == 0xEA95);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::bit_or<int> F;
assert(f(0x58D3, 0xEA95) == 0xFAD7);
assert(f(0x58D3, 0) == 0x58D3);
assert(f(0xFFFF, 0x58D3) == 0xFFFF);
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::bit_or<> F2;
const F2 f2 = F2();
assert(f2(0xEA95, 0xEA95) == 0xEA95);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(f(0x58D3, 0) == 0x58D3);
assert(f(0xFFFF, 0x58D3) == 0xA72C);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::bit_xor<> F2;
const F2 f = F2();
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::logical_and<int> F;
assert(!f(36, 0));
assert(!f(0, 36));
assert(!f(0, 0));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::logical_and<> F2;
const F2 f2 = F2();
assert( f2(36, 36));
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::logical_not<int> F;
static_assert((std::is_same<F::result_type, bool>::value), "" );
assert(!f(36));
assert(f(0));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::logical_not<> F2;
const F2 f2 = F2();
assert(!f2(36));
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::logical_or<int> F;
assert(f(36, 0));
assert(f(0, 36));
assert(!f(0, 0));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
typedef std::logical_or<> F2;
const F2 f2 = F2();
assert( f2(36, 36));
#include <utility>
+#include "test_macros.h"
+
int main()
{
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
// Should fail to compile, since float is not an integral type
using floatmix = std::integer_sequence<float>;
X
-#endif // _LIBCPP_STD_VER > 11
+#endif // TEST_STD_VER > 11
}
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
#include <MoveOnly.h>
int A_constructed = 0;
assert(A_constructed == i+1);
}
}
-#if _LIBCPP_STD_VER >= 14
+#if TEST_STD_VER >= 14
{
typedef MoveOnly S;
typedef std::aligned_storage<3*sizeof(S), std::alignment_of<S>::value>::type
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::integral_constant<int, 5> _5;
assert(_5() == 5);
#endif
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( _5{}() == 5, "" );
static_assert ( std::true_type{}(), "" );
#endif
#include <type_traits>
+#include "test_macros.h"
+
enum Enum {zero, one_};
template <class T, class U>
void test_remove_all_extents()
{
static_assert((std::is_same<typename std::remove_all_extents<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_all_extents_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
enum Enum {zero, one_};
template <class T, class U>
void test_remove_extent()
{
static_assert((std::is_same<typename std::remove_extent<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_extent_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_add_const_imp()
{
static_assert((std::is_same<typename std::add_const<T>::type, const U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::add_const_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_add_cv_imp()
{
static_assert((std::is_same<typename std::add_cv<T>::type, const volatile U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::add_cv_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_add_volatile_imp()
{
static_assert((std::is_same<typename std::add_volatile<T>::type, volatile U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::add_volatile_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_remove_const_imp()
{
static_assert((std::is_same<typename std::remove_const<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_const_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_remove_cv_imp()
{
static_assert((std::is_same<typename std::remove_cv<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_cv_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_remove_volatile_imp()
{
static_assert((std::is_same<typename std::remove_volatile<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::remove_volatile_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
#ifndef _LIBCPP_HAS_NO_VARIADICS
{
typedef std::aligned_union<10, char >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, char>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 1, "");
}
{
typedef std::aligned_union<10, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, short>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
}
{
typedef std::aligned_union<10, int >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, int>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
}
{
typedef std::aligned_union<10, double >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, double>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 8, "");
}
{
typedef std::aligned_union<10, short, char >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, short, char>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
}
{
typedef std::aligned_union<10, char, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<10, char, short>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 2, "");
}
{
typedef std::aligned_union<2, int, char, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, int, char, short>, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
}
{
typedef std::aligned_union<2, char, int, short >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, char, int, short >, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
}
{
typedef std::aligned_union<2, char, short, int >::type T1;
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(std::is_same<std::aligned_union_t<2, char, short, int >, T1>::value, "" );
#endif
static_assert(std::alignment_of<T1>::value == 4, "");
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
static_assert((std::is_same<std::conditional<true, char, int>::type, char>::value), "");
static_assert((std::is_same<std::conditional<false, char, int>::type, int>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::conditional_t<true, char, int>, char>::value), "");
static_assert((std::is_same<std::conditional_t<false, char, int>, int>::value), "");
#endif
#include <type_traits>
+#include "test_macros.h"
+
template <class T, class U>
void test_decay()
{
static_assert((std::is_same<typename std::decay<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::decay_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
int main()
{
static_assert((std::is_same<std::enable_if<true>::type, void>::value), "");
static_assert((std::is_same<std::enable_if<true, int>::type, int>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::enable_if_t<true>, void>::value), "");
static_assert((std::is_same<std::enable_if_t<true, int>, int>::value), "");
#endif
void test_make_signed()
{
static_assert((std::is_same<typename std::make_signed<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::make_signed_t<T>, U>::value), "");
#endif
}
void test_make_unsigned()
{
static_assert((std::is_same<typename std::make_unsigned<T>::type, U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<std::make_unsigned_t<T>, U>::value), "");
#endif
}
#include <type_traits>
+#include "test_macros.h"
+
template <class T>
void test_lvalue_ref()
{
static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_null_pointer<T>::value, "");
#endif
static_assert(!std::is_integral<T>::value, "");
#define _LIBCPP_HAS_NO_VARIADICS
#include <type_traits>
+#include "test_macros.h"
+
template <class T>
void test_member_function_pointer_imp()
{
static_assert(!std::is_void<T>::value, "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert(!std::is_null_pointer<T>::value, "");
#endif
static_assert(!std::is_integral<T>::value, "");
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class FromDuration, class ToDuration>
void
test(const FromDuration& df, const ToDuration& d)
}
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
template<class FromDuration, long long From, class ToDuration, long long To>
void test_constexpr ()
std::chrono::duration<double, std::ratio<3600> >(7265./3600));
test(std::chrono::duration<int, std::ratio<2, 3> >(9),
std::chrono::duration<int, std::ratio<3, 5> >(10));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::hours, 2> ();
test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::minutes,121> ();
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
assert( (t1 != t2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T1 t1(Duration1(3));
constexpr T1 t2(Duration1(3));
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
assert(!(t1 >= t2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr T1 t1(Duration1(3));
constexpr T1 t2(Duration1(3));
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
std::chrono::time_point<Clock, Duration1> t1 = t2;
assert(t1.time_since_epoch() == Duration1(3000));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(3));
constexpr std::chrono::time_point<Clock, Duration1> t1 = t2;
#include <chrono>
#include <cassert>
+#include "test_macros.h"
#include "../../rep.h"
int main()
std::chrono::time_point<Clock, Duration> t;
assert(t.time_since_epoch() == Duration::zero());
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration> t;
static_assert(t.time_since_epoch() == Duration::zero(), "");
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3));
assert(t.time_since_epoch() == Duration(3000));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration> t(Duration(3));
static_assert(t.time_since_epoch() == Duration(3), "");
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
t2 = Duration2(6) + t1;
assert(t2.time_since_epoch() == Duration2(3006));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
constexpr std::chrono::time_point<Clock, Duration2> t2 = t1 + Duration2(5);
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
std::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5);
assert(t2.time_since_epoch() == Duration2(2995));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
constexpr std::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5);
#include <chrono>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
typedef std::chrono::system_clock Clock;
std::chrono::time_point<Clock, Duration2> t2(Duration2(5));
assert((t1 - t2) == Duration2(2995));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3));
constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(5));
#include <cassert>
#include <type_traits>
+#include "test_macros.h"
#include "MoveOnly.h"
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct Empty {};
struct A
#include <string>
#include <cassert>
+#include "test_macros.h"
template <class ...>
struct never {
std::tuple<int> t(2);
assert(std::get<0>(t) == 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::tuple<int> t(2);
static_assert(std::get<0>(t) == 2, "");
assert(std::get<0>(t) == 2);
assert(std::get<1>(t) == nullptr);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::tuple<int, char*> t(2, nullptr);
static_assert(std::get<0>(t) == 2, "");
#include <utility>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(std::get<0>(t1) == 2);
assert(std::get<1>(t1) == short('a'));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<double, char> P0;
typedef std::tuple<int, short> T1;
#include <string>
#include <cassert>
+#include "test_macros.h"
+
struct Explicit {
int value;
explicit Explicit(int x) : value(x) {}
explicit D(int i) : B(i) {}
};
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct A
{
T1 t1 = t0;
assert(std::get<0>(t1) == 2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<double> T0;
typedef std::tuple<A> T1;
#include <string>
#include <cassert>
+#include "test_macros.h"
+
struct Empty {};
int main()
assert(std::get<1>(t) == 'a');
assert(std::get<2>(t) == "some text");
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<int> T;
constexpr T t0(2);
#include <type_traits>
#include <cassert>
+#include "test_macros.h"
+
template <class Tuple>
void
test0(const Tuple&)
assert(std::get<1>(t) == 'a');
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
template <class Tuple>
constexpr int
test3(const Tuple&)
double i = 2.5;
char c = 'a';
test2a(std::forward_as_tuple(i, c));
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert ( test3 (std::forward_as_tuple(i, c)) == 2, "" );
#endif
}
#include <functional>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(i == 0);
assert(j == 0);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr auto t1 = std::make_tuple(0, 1, 3.14);
constexpr int i1 = std::get<1>(t1);
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(i == 42);
assert(s == "C++");
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
static constexpr int i = 42;
static constexpr double f = 1.1;
#include <string>
#include <cassert>
+#include "test_macros.h"
#include "MoveOnly.h"
int main()
assert(std::get<0>(t) == 1);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
constexpr std::tuple<> t = std::tuple_cat();
((void)t); // Prevent unused warning
#include <string>
#include <cassert>
+#include "test_macros.h"
+
struct Empty {};
int main()
assert(std::get<0>(t) == "high");
assert(std::get<1>(t) == 5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<double, int> T;
constexpr T t(2.718, 5);
assert(std::get<2>(t) == 4);
assert(d == 2.5);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{ // get on an rvalue tuple
static_assert ( std::get<0> ( std::make_tuple ( 0.0f, 1, 2.0, 3L )) == 0, "" );
static_assert ( std::get<1> ( std::make_tuple ( 0.0f, 1, 2.0, 3L )) == 1, "" );
#include <tuple>
#include <type_traits>
+#include "test_macros.h"
+
template <class T, std::size_t N, class U>
void test()
{
static_assert((std::is_same<typename std::tuple_element<N, const T>::type, const U>::value), "");
static_assert((std::is_same<typename std::tuple_element<N, volatile T>::type, volatile U>::value), "");
static_assert((std::is_same<typename std::tuple_element<N, const volatile T>::type, const volatile U>::value), "");
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
static_assert((std::is_same<typename std::tuple_element_t<N, T>, U>::value), "");
static_assert((std::is_same<typename std::tuple_element_t<N, const T>, const U>::value), "");
static_assert((std::is_same<typename std::tuple_element_t<N, volatile T>, volatile U>::value), "");
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(!(t1 == t2));
assert(t1 != t2);
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<char, int, double> T1;
typedef std::tuple<double, char, int> T2;
#include <string>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert(!(t1 > t2));
assert(!(t1 >= t2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::tuple<char, int, double> T1;
typedef std::tuple<double, char, int> T2;
#include <utility>
#include <cassert>
+#include "test_macros.h"
+
int main()
{
{
assert( (p1 >= p2));
}
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
{
typedef std::pair<int, short> P;
constexpr P p1(3, 4);
#ifndef TRANSPARENT_H
#define TRANSPARENT_H
+#include "test_macros.h"
+
// testing transparent
-#if _LIBCPP_STD_VER > 11
+#if TEST_STD_VER > 11
struct transparent_less
{