Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/gsl/gsl2
-rw-r--r--include/gsl/gsl_algorithm7
-rw-r--r--include/gsl/gsl_assert2
-rw-r--r--include/gsl/gsl_util10
-rw-r--r--include/gsl/multi_span25
-rw-r--r--include/gsl/pointers10
-rw-r--r--include/gsl/span18
-rw-r--r--include/gsl/string_span16
-rw-r--r--tests/algorithm_tests.cpp12
-rw-r--r--tests/assertion_tests.cpp4
-rw-r--r--tests/at_tests.cpp14
-rw-r--r--tests/bounds_tests.cpp10
-rw-r--r--tests/byte_tests.cpp11
-rw-r--r--tests/multi_span_tests.cpp28
-rw-r--r--tests/notnull_tests.cpp17
-rw-r--r--tests/owner_tests.cpp7
-rw-r--r--tests/span_tests.cpp30
-rw-r--r--tests/strided_span_tests.cpp21
-rw-r--r--tests/string_span_tests.cpp22
-rw-r--r--tests/utils_tests.cpp9
20 files changed, 165 insertions, 110 deletions
diff --git a/include/gsl/gsl b/include/gsl/gsl
index ec9632c..44a18fa 100644
--- a/include/gsl/gsl
+++ b/include/gsl/gsl
@@ -20,8 +20,8 @@
#include <gsl/gsl_assert> // Ensures/Expects
#include <gsl/gsl_util> // finally()/narrow()/narrow_cast()...
#include <gsl/multi_span> // multi_span, strided_span...
+#include <gsl/pointers> // owner, not_null
#include <gsl/span> // span
#include <gsl/string_span> // zstring, string_span, zstring_builder...
-#include <gsl/pointers> // owner, not_null
#endif // GSL_GSL_H
diff --git a/include/gsl/gsl_algorithm b/include/gsl/gsl_algorithm
index 9e6678a..710792f 100644
--- a/include/gsl/gsl_algorithm
+++ b/include/gsl/gsl_algorithm
@@ -17,9 +17,12 @@
#ifndef GSL_ALGORITHM_H
#define GSL_ALGORITHM_H
-#include <gsl/span>
+#include <gsl/gsl_assert> // for Expects
+#include <gsl/span> // for dynamic_extent, span
-#include <algorithm>
+#include <algorithm> // for copy_n
+#include <cstddef> // for ptrdiff_t
+#include <type_traits> // for is_assignable
#ifdef _MSC_VER
#pragma warning(push)
diff --git a/include/gsl/gsl_assert b/include/gsl/gsl_assert
index 2157673..468d4a0 100644
--- a/include/gsl/gsl_assert
+++ b/include/gsl/gsl_assert
@@ -18,7 +18,7 @@
#define GSL_CONTRACTS_H
#include <exception>
-#include <stdexcept>
+#include <stdexcept> // for logic_error
//
// There are three configuration options for this GSL implementation's behavior
diff --git a/include/gsl/gsl_util b/include/gsl/gsl_util
index 86a3ad7..caf56d8 100644
--- a/include/gsl/gsl_util
+++ b/include/gsl/gsl_util
@@ -17,12 +17,14 @@
#ifndef GSL_UTIL_H
#define GSL_UTIL_H
-#include <gsl/gsl_assert> // Ensures/Expects
+#include <gsl/gsl_assert> // for Expects
#include <array>
-#include <exception>
-#include <type_traits>
-#include <utility>
+#include <cstddef> // for ptrdiff_t, size_t
+#include <exception> // for exception
+#include <initializer_list> // for initializer_list
+#include <type_traits> // for is_signed, integral_constant
+#include <utility> // for forward
#if defined(_MSC_VER)
diff --git a/include/gsl/multi_span b/include/gsl/multi_span
index 4b2dc0f..cdde594 100644
--- a/include/gsl/multi_span
+++ b/include/gsl/multi_span
@@ -17,22 +17,24 @@
#ifndef GSL_MULTI_SPAN_H
#define GSL_MULTI_SPAN_H
-#include <gsl/gsl_assert>
-#include <gsl/gsl_byte>
-#include <gsl/gsl_util>
+#include <gsl/gsl_assert> // for Expects
+#include <gsl/gsl_byte> // for byte
+#include <gsl/gsl_util> // for narrow_cast
-#include <algorithm>
-#include <array>
+#include <algorithm> // for transform, lexicographical_compare
+#include <array> // for array
#include <cassert>
-#include <cstddef>
-#include <cstdint>
-#include <functional>
-#include <iterator>
-#include <limits>
+#include <cstddef> // for ptrdiff_t, size_t, nullptr_t
+#include <cstdint> // for PTRDIFF_MAX
+#include <functional> // for divides, multiplies, minus, negate, plus
+#include <initializer_list> // for initializer_list
+#include <iterator> // for iterator, random_access_iterator_tag
+#include <limits> // for numeric_limits
#include <new>
#include <numeric>
#include <stdexcept>
-#include <type_traits>
+#include <string> // for basic_string
+#include <type_traits> // for enable_if_t, remove_cv_t, is_same, is_co...
#include <utility>
#ifdef _MSC_VER
@@ -1070,7 +1072,6 @@ inline constexpr dim_t<N> dim(std::ptrdiff_t n) GSL_NOEXCEPT
template <typename ValueType, std::ptrdiff_t FirstDimension = dynamic_range,
std::ptrdiff_t... RestDimensions>
class multi_span;
-
template <typename ValueType, std::size_t Rank>
class strided_span;
diff --git a/include/gsl/pointers b/include/gsl/pointers
index 1c91e52..163a2fe 100644
--- a/include/gsl/pointers
+++ b/include/gsl/pointers
@@ -17,11 +17,13 @@
#ifndef GSL_POINTERS_H
#define GSL_POINTERS_H
-#include <gsl/gsl_assert>
+#include <gsl/gsl_assert> // for Ensures, Expects
-#include <iosfwd>
-#include <memory>
-#include <type_traits>
+#include <algorithm> // for forward
+#include <iosfwd> // for ptrdiff_t, nullptr_t, ostream, size_t
+#include <memory> // for shared_ptr, unique_ptr
+#include <system_error> // for hash
+#include <type_traits> // for enable_if_t, is_convertible, is_assignable
#if defined(_MSC_VER) && _MSC_VER < 1910
#pragma push_macro("constexpr")
diff --git a/include/gsl/span b/include/gsl/span
index 98fe768..bd9a21d 100644
--- a/include/gsl/span
+++ b/include/gsl/span
@@ -17,16 +17,18 @@
#ifndef GSL_SPAN_H
#define GSL_SPAN_H
-#include <gsl/gsl_assert>
-#include <gsl/gsl_byte>
-#include <gsl/gsl_util>
-
-#include <array>
-#include <iterator>
+#include <gsl/gsl_assert> // for Expects
+#include <gsl/gsl_byte> // for byte
+#include <gsl/gsl_util> // for narrow_cast, narrow
+
+#include <algorithm> // for lexicographical_compare
+#include <array> // for array
+#include <cstddef> // for ptrdiff_t, size_t, nullptr_t
+#include <iterator> // for reverse_iterator, distance, random_access_...
#include <limits>
-#include <memory>
+#include <memory> // for unique_ptr, shared_ptr
#include <stdexcept>
-#include <type_traits>
+#include <type_traits> // for enable_if_t, declval, is_convertible, inte...
#include <utility>
#ifdef _MSC_VER
diff --git a/include/gsl/string_span b/include/gsl/string_span
index f6fe4eb..fa8b515 100644
--- a/include/gsl/string_span
+++ b/include/gsl/string_span
@@ -17,13 +17,17 @@
#ifndef GSL_STRING_SPAN_H
#define GSL_STRING_SPAN_H
-#include <gsl/gsl_assert>
-#include <gsl/gsl_util>
-#include <gsl/span>
-
-#include <cstdint>
+#include <gsl/gsl_assert> // for Ensures, Expects
+#include <gsl/gsl_util> // for narrow_cast
+#include <gsl/span> // for operator!=, operator==, dynamic_extent
+
+#include <algorithm> // for equal, lexicographical_compare
+#include <array> // for array
+#include <cstddef> // for ptrdiff_t, size_t, nullptr_t
+#include <cstdint> // for PTRDIFF_MAX
#include <cstring>
-#include <string>
+#include <string> // for basic_string, allocator, char_traits
+#include <type_traits> // for declval, is_convertible, enable_if_t, add_...
#ifdef _MSC_VER
#pragma warning(push)
diff --git a/tests/algorithm_tests.cpp b/tests/algorithm_tests.cpp
index 045fd3e..388d17d 100644
--- a/tests/algorithm_tests.cpp
+++ b/tests/algorithm_tests.cpp
@@ -14,11 +14,17 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHE...
-#include <gsl/gsl_algorithm>
+#include <gsl/gsl_algorithm> // for copy
+#include <gsl/span> // for span
-#include <array>
+#include <array> // for array
+#include <cstddef> // for size_t
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using namespace std;
using namespace gsl;
diff --git a/tests/assertion_tests.cpp b/tests/assertion_tests.cpp
index 42966d1..25c0089 100644
--- a/tests/assertion_tests.cpp
+++ b/tests/assertion_tests.cpp
@@ -14,9 +14,9 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
-#include <gsl/gsl>
+#include <gsl/gsl_assert> // for fail_fast (ptr only), Ensures, Expects
using namespace gsl;
diff --git a/tests/at_tests.cpp b/tests/at_tests.cpp
index 78e8e3d..2f9e999 100644
--- a/tests/at_tests.cpp
+++ b/tests/at_tests.cpp
@@ -14,12 +14,18 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK_THROW...
-#include <gsl/gsl>
+#include <gsl/gsl_util> // for at
-#include <initializer_list>
-#include <vector>
+#include <array> // for array
+#include <cstddef> // for size_t
+#include <initializer_list> // for initializer_list
+#include <vector> // for vector
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using gsl::fail_fast;
diff --git a/tests/bounds_tests.cpp b/tests/bounds_tests.cpp
index 51b5393..1f4b1e2 100644
--- a/tests/bounds_tests.cpp
+++ b/tests/bounds_tests.cpp
@@ -14,11 +14,15 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, TEST_CASE
-#include <gsl/multi_span>
+#include <gsl/multi_span> // for static_bounds, static_bounds_dynamic_range_t
-#include <vector>
+#include <cstddef> // for ptrdiff_t, size_t
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using namespace std;
using namespace gsl;
diff --git a/tests/byte_tests.cpp b/tests/byte_tests.cpp
index 2c6259d..41501ce 100644
--- a/tests/byte_tests.cpp
+++ b/tests/byte_tests.cpp
@@ -14,16 +14,9 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
-#include <gsl/gsl_byte>
-
-#include <iostream>
-#include <list>
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
+#include <gsl/gsl_byte> // for to_byte, to_integer, byte, operator&, ope...
using namespace std;
using namespace gsl;
diff --git a/tests/multi_span_tests.cpp b/tests/multi_span_tests.cpp
index af58d76..52df759 100644
--- a/tests/multi_span_tests.cpp
+++ b/tests/multi_span_tests.cpp
@@ -14,16 +14,24 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
-
-#include <gsl/multi_span>
-
-#include <iostream>
-#include <list>
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
+
+#include <gsl/gsl_byte> // for byte
+#include <gsl/gsl_util> // for narrow_cast
+#include <gsl/multi_span> // for multi_span, contiguous_span_iterator, dim
+
+#include <algorithm> // for fill, for_each
+#include <array> // for array
+#include <iostream> // for ptrdiff_t, size_t
+#include <iterator> // for reverse_iterator, begin, end, operator!=
+#include <numeric> // for iota
+#include <stddef.h> // for ptrdiff_t
+#include <string> // for string
+#include <vector> // for vector
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using namespace std;
using namespace gsl;
diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp
index 6c841f0..50b15f6 100644
--- a/tests/notnull_tests.cpp
+++ b/tests/notnull_tests.cpp
@@ -14,13 +14,20 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
-#include <gsl/pointers>
+#include <gsl/pointers> // for not_null, operator<, operator<=, operator>
-#include <memory>
-#include <string>
-#include <vector>
+#include <algorithm> // for addressof
+#include <memory> // for shared_ptr, make_shared, operator<, opera...
+#include <sstream> // for operator<<, ostringstream, basic_ostream:...
+#include <stdint.h> // for uint16_t
+#include <string> // for basic_string, operator==, string, operator<<
+#include <typeinfo> // for type_info
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using namespace gsl;
diff --git a/tests/owner_tests.cpp b/tests/owner_tests.cpp
index dbc8d16..94822f5 100644
--- a/tests/owner_tests.cpp
+++ b/tests/owner_tests.cpp
@@ -14,12 +14,9 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
-#include <gsl/pointers>
-
-#include <functional>
-#include <memory>
+#include <gsl/pointers> // for owner
using namespace gsl;
diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp
index bc4666b..b14ddf0 100644
--- a/tests/span_tests.cpp
+++ b/tests/span_tests.cpp
@@ -14,17 +14,25 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
-
-#include <gsl/span>
-
-#include <iostream>
-#include <list>
-#include <map>
-#include <memory>
-#include <regex>
-#include <string>
-#include <vector>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+
+#include <gsl/gsl_byte> // for byte
+#include <gsl/gsl_util> // for narrow_cast, at
+#include <gsl/span> // for span, span_iterator, operator==, operator!=
+
+#include <array> // for array
+#include <iostream> // for ptrdiff_t
+#include <iterator> // for reverse_iterator, operator-, operator==
+#include <memory> // for unique_ptr, shared_ptr, make_unique, allo...
+#include <regex> // for match_results, sub_match, match_results<>...
+#include <stddef.h> // for ptrdiff_t
+#include <string> // for string
+#include <type_traits> // for integral_constant<>::value, is_default_co...
+#include <vector> // for vector
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using namespace std;
using namespace gsl;
diff --git a/tests/strided_span_tests.cpp b/tests/strided_span_tests.cpp
index 14400d4..2c1c047 100644
--- a/tests/strided_span_tests.cpp
+++ b/tests/strided_span_tests.cpp
@@ -14,16 +14,21 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, CHECK...
-#include <gsl/multi_span>
+#include <gsl/gsl_byte> // for byte
+#include <gsl/gsl_util> // for narrow_cast
+#include <gsl/multi_span> // for strided_span, index, multi_span, strided_...
-#include <iostream>
-#include <list>
-#include <map>
-#include <memory>
-#include <string>
-#include <vector>
+#include <iostream> // for size_t
+#include <iterator> // for begin, end
+#include <numeric> // for iota
+#include <type_traits> // for integral_constant<>::value, is_convertible
+#include <vector> // for vector
+
+namespace gsl {
+struct fail_fast;
+} // namespace gsl
using namespace std;
using namespace gsl;
diff --git a/tests/string_span_tests.cpp b/tests/string_span_tests.cpp
index 823b19d..83171ac 100644
--- a/tests/string_span_tests.cpp
+++ b/tests/string_span_tests.cpp
@@ -14,15 +14,19 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
-
-#include <gsl/gsl> //owner
-#include <gsl/string_span>
-
-#include <algorithm>
-#include <cstdlib>
-#include <map>
-#include <vector>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
+
+#include <gsl/gsl_assert> // for Expects, fail_fast (ptr only)
+#include <gsl/pointers> // for owner
+#include <gsl/span> // for span, dynamic_extent
+#include <gsl/string_span> // for basic_string_span, operator==, ensure_z
+
+#include <algorithm> // for move, find
+#include <cstddef> // for size_t
+#include <map> // for map
+#include <string> // for basic_string, string, char_traits, operat...
+#include <type_traits> // for remove_reference<>::type
+#include <vector> // for vector, allocator
using namespace std;
using namespace gsl;
diff --git a/tests/utils_tests.cpp b/tests/utils_tests.cpp
index 67cceb5..610efbf 100644
--- a/tests/utils_tests.cpp
+++ b/tests/utils_tests.cpp
@@ -14,11 +14,14 @@
//
///////////////////////////////////////////////////////////////////////////////
-#include <catch/catch.hpp>
+#include <catch/catch.hpp> // for AssertionHandler, StringRef, CHECK, TEST_...
-#include <gsl/gsl>
+#include <gsl/gsl_util> // for narrow, finally, narrow_cast, narrowing_e...
-#include <functional>
+#include <algorithm> // for move
+#include <functional> // for reference_wrapper, _Bind_helper<>::type
+#include <limits> // for numeric_limits
+#include <stdint.h> // for uint32_t, int32_t
using namespace gsl;