diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2014-03-03 01:24:04 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2014-03-03 01:24:04 +0000 |
| commit | 6a640a18a48e147a16b4f329f0f4e272e681a3e3 (patch) | |
| tree | 71fe238911201661564bab7b83276505aee16399 /libcxx/test | |
| parent | 925ec9b11e5856ec722aafa0ab7acd3303b03ee1 (diff) | |
| download | bcm5719-llvm-6a640a18a48e147a16b4f329f0f4e272e681a3e3.tar.gz bcm5719-llvm-6a640a18a48e147a16b4f329f0f4e272e681a3e3.zip | |
Implement LWG Issue #2285 - make_reverse_iterator. Also mark issues #1450 and #2205 as complete; they are just wording changes in the standard. Mark issues #2359, #2320 and #2322 as complete - libc++ implements them already.
llvm-svn: 202671
Diffstat (limited to 'libcxx/test')
| -rw-r--r-- | libcxx/test/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/libcxx/test/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp b/libcxx/test/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp new file mode 100644 index 00000000000..c97d954479d --- /dev/null +++ b/libcxx/test/iterators/predef.iterators/reverse.iterators/reverse.iter.ops/reverse.iter.make/make_reverse_iterator.pass.cpp @@ -0,0 +1,42 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <iterator> + +// reverse_iterator + +// template <class Iterator> reverse_iterator<Iterator> +// make_reverse_iterator(Iterator i); + +#include <iterator> +#include <cassert> + +#include "test_iterators.h" + +#if _LIBCPP_STD_VER > 11 + +template <class It> +void +test(It i) +{ + const std::reverse_iterator<It> r = std::make_reverse_iterator(i); + assert(r.base() == i); +} + +int main() +{ + const char* s = "1234567890"; + random_access_iterator<const char*>b(s); + random_access_iterator<const char*>e(s+10); + while ( b != e ) + test ( b++ ); +} +#else +int main () {} +#endif |

