diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:08 +0000 |
commit | 0564cdb94a7a1facbb0dbf888ceb90638aa70ecd (patch) | |
tree | 3ccbf1ba827928fca93419d0b6cf83ce0f650f2a /test/std/iterators/iterator.container/empty.pass.cpp | |
parent | dbabdb5220c44e5938d404eefb84b5ed55667ea8 (diff) |
Notes
Diffstat (limited to 'test/std/iterators/iterator.container/empty.pass.cpp')
-rw-r--r-- | test/std/iterators/iterator.container/empty.pass.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/std/iterators/iterator.container/empty.pass.cpp b/test/std/iterators/iterator.container/empty.pass.cpp index f9b8b94a89f9..cd000cc2fe76 100644 --- a/test/std/iterators/iterator.container/empty.pass.cpp +++ b/test/std/iterators/iterator.container/empty.pass.cpp @@ -7,17 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11, c++14 + // <iterator> // template <class C> constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17 // template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept; // C++17 // template <class E> constexpr bool empty(initializer_list<E> il) noexcept; // C++17 -#include "test_macros.h" - -#if TEST_STD_VER <= 14 -int main () {} -#else - #include <iterator> #include <cassert> #include <vector> @@ -25,9 +21,12 @@ int main () {} #include <list> #include <initializer_list> +#include "test_macros.h" + template<typename C> void test_const_container( const C& c ) { +// Can't say noexcept here because the container might not be assert ( std::empty(c) == c.empty()); } @@ -40,18 +39,21 @@ void test_const_container( const std::initializer_list<T>& c ) template<typename C> void test_container( C& c ) { +// Can't say noexcept here because the container might not be assert ( std::empty(c) == c.empty()); } template<typename T> void test_container( std::initializer_list<T>& c ) { + ASSERT_NOEXCEPT(std::empty(c)); assert ( std::empty(c) == (c.size() == 0)); } template<typename T, size_t Sz> void test_const_array( const T (&array)[Sz] ) { + ASSERT_NOEXCEPT(std::empty(array)); assert (!std::empty(array)); } @@ -75,5 +77,3 @@ int main() static constexpr int arrA [] { 1, 2, 3 }; test_const_array ( arrA ); } - -#endif |