diff options
Diffstat (limited to 'test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp')
-rw-r--r-- | test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp index 6de708baa..5665cb86c 100644 --- a/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp +++ b/test/std/iterators/predef.iterators/move.iterators/move.iter.ops/move.iter.op.star/op_star.pass.cpp @@ -12,6 +12,8 @@ // move_iterator // reference operator*() const; +// +// constexpr in C++17 #include <iterator> #include <cassert> @@ -19,6 +21,8 @@ #include <memory> #endif +#include "test_macros.h" + class A { int data_; @@ -58,4 +62,15 @@ int main() std::unique_ptr<int, do_nothing> p(&i); test(&p, std::unique_ptr<int, do_nothing>(&i)); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + +#if TEST_STD_VER > 14 + { + constexpr const char *p = "123456789"; + typedef std::move_iterator<const char *> MI; + constexpr MI it1 = std::make_move_iterator(p); + constexpr MI it2 = std::make_move_iterator(p+1); + static_assert(*it1 == p[0], ""); + static_assert(*it2 == p[1], ""); + } +#endif } |