libstdc++: Reduce header dependencies in <span>
authorJonathan Wakely <jwakely@redhat.com>
Tue, 10 Dec 2019 16:15:55 +0000 (16:15 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 10 Dec 2019 16:15:55 +0000 (16:15 +0000)
* include/std/span: Do not include <tuple> and <utility>.
(tuple_size, tuple_element): Declare.

From-SVN: r279171

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/span

index f25e0407bfaeba7b394e55b3ec2f61ae8e5d7867..38c844117f41782eccbdf1ff0e2c22d1704d707f 100644 (file)
@@ -1,5 +1,8 @@
 2019-12-10  Jonathan Wakely  <jwakely@redhat.com>
 
+       * include/std/span: Do not include <tuple> and <utility>.
+       (tuple_size, tuple_element): Declare.
+
        * include/bits/iterator_concepts.h (indirect_result_t): Do not apply
        iter_reference_t to parameter pack.
        * testsuite/24_iterators/indirect_callable/projected.cc: New test.
index f215decb453c60970a579a96fae6ad428f6d327c..ecce0b33b0bbd0e8f686996f7d311699969ac9bf 100644 (file)
@@ -39,8 +39,6 @@
 #if __cplusplus > 201703L
 
 #include <type_traits>
-#include <tuple>
-#include <utility>
 #include <array>
 #include <bits/stl_iterator.h>
 #include <bits/range_access.h>
@@ -451,6 +449,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       return __sp[_Index];
     }
 
+  template<typename _Tp> struct tuple_size;
+  template<size_t __i, typename _Tp> struct tuple_element;
+
   template<typename _Type, size_t _Extent>
     struct tuple_size<span<_Type, _Extent>>
     : public integral_constant<size_t, _Extent>