From 31440829097397a857076fc7785a4ceffc076bac Mon Sep 17 00:00:00 2001 From: "Jordan Maples [MSFT]" <49793787+JordanMaples@users.noreply.github.com> Date: Mon, 24 Feb 2020 11:16:26 -0800 Subject: [PATCH] forward declare span and remove header --- include/gsl/span | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/gsl/span b/include/gsl/span index 23c58c9..e8ca691 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -21,7 +21,6 @@ #include // for byte #include // for narrow_cast, narrow -#include // for array #include // for ptrdiff_t, size_t, nullptr_t #include // for reverse_iterator, distance, random_access_... #include // for enable_if_t, declval, is_convertible, inte... @@ -63,6 +62,15 @@ #pragma GCC diagnostic ignored "-Wsign-conversion" #endif +namespace std +{ +// forward declaring std::array. +// array is only used for a few constructors, so pulling the entire header is unnecessary for span. +// The end user's logic will pull in the actual definition of array if they need it. +template +class array; +} + namespace gsl {