Ensure <experimental/iterator> includes <iterator>
authorJonathan Wakely <jwakely@redhat.com>
Thu, 23 Feb 2017 18:25:22 +0000 (18:25 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 23 Feb 2017 18:25:22 +0000 (18:25 +0000)
* include/experimental/iterator: Include <iterator>.
* testsuite/experimental/iterator/requirements.cc: Check for contents
of <iterator>.

From-SVN: r245686

libstdc++-v3/ChangeLog
libstdc++-v3/include/experimental/iterator
libstdc++-v3/testsuite/experimental/iterator/requirements.cc

index 0b02dcac602dac9816374c75514f46c9b6d2468b..6193f4e5ae684ecf07a4f3e66ad8c2cf6599899e 100644 (file)
@@ -1,3 +1,9 @@
+2017-02-23  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/experimental/iterator: Include <iterator>.
+       * testsuite/experimental/iterator/requirements.cc: Check for contents
+       of <iterator>.
+
 2017-02-19  Dinka Ranns  <dinka.ranns@googlemail.com>
 
        C++17 GB50 resolution
index e8ecb34a7d0b8640d7446fe9d4f33d5b9dcadd27..8a8395da759cd7a1e090d310a8142f9745a85237 100644 (file)
 # include <bits/c++14_warning.h>
 #else
 
-#include <experimental/type_traits>
+#include <iterator>
 #include <iosfwd>
-#include <bits/move.h>
-#include <bits/stl_iterator_base_types.h>
+#include <experimental/type_traits>
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
index 8a8e79e245710b59e70c5d34a1932c0bd23e2f0b..5fa58724b4bd0b44862f2900110e892da4631dbf 100644 (file)
@@ -19,7 +19,7 @@
 
 // This is a compile-only test with minimal includes
 #include <experimental/iterator>
-#include <iosfwd>
+#include <iosfwd> // No guarantee that <experimental/iterator> includes this!
 
 using namespace std::experimental;
 
@@ -55,3 +55,13 @@ tester<int, char> ic;
 tester<wchar_t, wchar_t> ww;
 tester<int, wchar_t> iw;
 #endif
+
+std::ostream& os();
+
+// Ensure that contents of <iterator> are defined by <experimental/iterator>:
+std::reverse_iterator<int*> ii;
+std::move_iterator<int*> mi;
+std::istream_iterator<int> isi;
+std::ostream_iterator<int> osi(os());
+std::istreambuf_iterator<char> isbi;
+std::ostreambuf_iterator<char> osbi(os());