libstdc++: Reduce header dependencies in <span>
diff mbox series

Message ID 20191210161646.GA2035213@redhat.com
State New
Headers show
Series
  • libstdc++: Reduce header dependencies in <span>
Related show

Commit Message

Jonathan Wakely Dec. 10, 2019, 4:16 p.m. UTC
* include/std/span: Do not include <tuple> and <utility>.
	(tuple_size, tuple_element): Declare.

Tested powerpc64le-linux, committed to trunk.
commit a32163a1de2a84dde15df80dd33e54a57746d6eb
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Dec 10 15:59:54 2019 +0000

    libstdc++: Reduce header dependencies in <span>
    
            * include/std/span: Do not include <tuple> and <utility>.
            (tuple_size, tuple_element): Declare.

Patch
diff mbox series

diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span
index f215decb453..ecce0b33b0b 100644
--- a/libstdc++-v3/include/std/span
+++ b/libstdc++-v3/include/std/span
@@ -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>