diff options
Diffstat (limited to 'test/std/iterators/iterator.range/begin-end.pass.cpp')
-rw-r--r-- | test/std/iterators/iterator.range/begin-end.pass.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/test/std/iterators/iterator.range/begin-end.pass.cpp b/test/std/iterators/iterator.range/begin-end.pass.cpp index ec3f61789b27..68186919198d 100644 --- a/test/std/iterators/iterator.range/begin-end.pass.cpp +++ b/test/std/iterators/iterator.range/begin-end.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// XFAIL: c++03, c++98 + // <iterator> // template <class C> auto begin(C& c) -> decltype(c.begin()); // template <class C> auto begin(const C& c) -> decltype(c.begin()); @@ -17,7 +19,6 @@ #include "test_macros.h" -#if TEST_STD_VER >= 11 #include <iterator> #include <cassert> #include <vector> @@ -31,7 +32,7 @@ void test_const_container( const C & c, typename C::value_type val ) { 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()); @@ -50,7 +51,7 @@ void test_const_container( const std::initializer_list<T> & c, T val ) { 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()); @@ -71,7 +72,7 @@ void test_container( C & c, typename C::value_type val ) { 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()); @@ -90,7 +91,7 @@ void test_container( std::initializer_list<T> & c, T val ) { 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()); @@ -110,7 +111,7 @@ void test_const_array( const T (&array)[Sz] ) { 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)); @@ -136,13 +137,9 @@ int main(){ 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, ""); #endif } - -#else -int main(){} -#endif |