quoted form of #include when GSL includes GSL files (#1030)

[SF.12: Prefer the quoted form of #include for files relative to the including file and the angle bracket form everywhere else](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rs-incform)

Additionally changed #include order in `span` so that all `span_ext` is in the GSL include block and not in the STL include block.

Fixes issues #1025.

Co-authored-by: Werner Henze <w.henze@avm.de>
This commit is contained in:
Werner Henze 2022-01-31 22:06:42 +01:00 committed by GitHub
parent a353456718
commit 4377f6e603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 32 additions and 32 deletions

View File

@ -17,8 +17,8 @@
#ifndef GSL_ALGORITHM_H #ifndef GSL_ALGORITHM_H
#define GSL_ALGORITHM_H #define GSL_ALGORITHM_H
#include <gsl/assert> // for Expects #include "assert" // for Expects
#include <gsl/span> // for dynamic_extent, span #include "span" // for dynamic_extent, span
#include <algorithm> // for copy_n #include <algorithm> // for copy_n
#include <cstddef> // for ptrdiff_t #include <cstddef> // for ptrdiff_t

View File

@ -17,16 +17,16 @@
#ifndef GSL_GSL_H #ifndef GSL_GSL_H
#define GSL_GSL_H #define GSL_GSL_H
#include <gsl/algorithm> // copy #include "algorithm" // copy
#include <gsl/assert> // Ensures/Expects #include "assert" // Ensures/Expects
#include <gsl/byte> // byte #include "byte" // byte
#include <gsl/pointers> // owner, not_null #include "pointers" // owner, not_null
#include <gsl/span> // span #include "span" // span
#include <gsl/string_span> // zstring, string_span, zstring_builder... #include "string_span" // zstring, string_span, zstring_builder...
#include <gsl/util> // finally()/narrow_cast()... #include "util" // finally()/narrow_cast()...
#ifdef __cpp_exceptions #ifdef __cpp_exceptions
#include <gsl/narrow> // narrow() #include "narrow" // narrow()
#endif #endif
#endif // GSL_GSL_H #endif // GSL_GSL_H

View File

@ -1,4 +1,4 @@
#pragma once #pragma once
#pragma message( \ #pragma message( \
"This header will soon be removed. Use <gsl/algorithm> instead of <gsl/gsl_algorithm>") "This header will soon be removed. Use <gsl/algorithm> instead of <gsl/gsl_algorithm>")
#include <gsl/algorithm> #include "algorithm"

View File

@ -1,3 +1,3 @@
#pragma once #pragma once
#pragma message("This header will soon be removed. Use <gsl/assert> instead of <gsl/gsl_assert>") #pragma message("This header will soon be removed. Use <gsl/assert> instead of <gsl/gsl_assert>")
#include <gsl/assert> #include "assert"

View File

@ -1,3 +1,3 @@
#pragma once #pragma once
#pragma message("This header will soon be removed. Use <gsl/byte> instead of <gsl/gsl_byte>") #pragma message("This header will soon be removed. Use <gsl/byte> instead of <gsl/gsl_byte>")
#include <gsl/byte> #include "byte"

View File

@ -1,3 +1,3 @@
#pragma once #pragma once
#pragma message("This header will soon be removed. Use <gsl/narrow> instead of <gsl/gsl_narrow>") #pragma message("This header will soon be removed. Use <gsl/narrow> instead of <gsl/gsl_narrow>")
#include <gsl/narrow> #include "narrow"

View File

@ -1,3 +1,3 @@
#pragma once #pragma once
#pragma message("This header will soon be removed. Use <gsl/util> instead of <gsl/gsl_util>") #pragma message("This header will soon be removed. Use <gsl/util> instead of <gsl/gsl_util>")
#include <gsl/util> #include "util"

View File

@ -16,8 +16,8 @@
#ifndef GSL_NARROW_H #ifndef GSL_NARROW_H
#define GSL_NARROW_H #define GSL_NARROW_H
#include <gsl/assert> // for Expects #include "assert" // for Expects
#include <gsl/util> // for narrow_cast #include "util" // for narrow_cast
namespace gsl namespace gsl
{ {
struct narrowing_error : public std::exception struct narrowing_error : public std::exception

View File

@ -17,7 +17,7 @@
#ifndef GSL_POINTERS_H #ifndef GSL_POINTERS_H
#define GSL_POINTERS_H #define GSL_POINTERS_H
#include <gsl/assert> // for Ensures, Expects #include "assert" // for Ensures, Expects
#include <algorithm> // for forward #include <algorithm> // for forward
#include <cstddef> // for ptrdiff_t, nullptr_t, size_t #include <cstddef> // for ptrdiff_t, nullptr_t, size_t

View File

@ -17,15 +17,15 @@
#ifndef GSL_SPAN_H #ifndef GSL_SPAN_H
#define GSL_SPAN_H #define GSL_SPAN_H
#include <gsl/assert> // for Expects #include "assert" // for Expects
#include <gsl/byte> // for byte #include "byte" // for byte
#include <gsl/util> // for narrow_cast #include "span_ext" // for span specialization of gsl::at and other span-related extensions
#include "util" // for narrow_cast
#include <array> // for array #include <array> // for array
#include <cstddef> // for ptrdiff_t, size_t, nullptr_t #include <cstddef> // for ptrdiff_t, size_t, nullptr_t
#include <gsl/span_ext> // for span specialization of gsl::at and other span-related extensions #include <iterator> // for reverse_iterator, distance, random_access_...
#include <iterator> // for reverse_iterator, distance, random_access_... #include <type_traits> // for enable_if_t, declval, is_convertible, inte...
#include <type_traits> // for enable_if_t, declval, is_convertible, inte...
#if defined(_MSC_VER) && !defined(__clang__) #if defined(_MSC_VER) && !defined(__clang__)
#pragma warning(push) #pragma warning(push)

View File

@ -27,8 +27,8 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <gsl/assert> // GSL_KERNEL_MODE #include "assert" // GSL_KERNEL_MODE
#include <gsl/util> // for narrow_cast, narrow #include "util" // for narrow_cast, narrow
#include <cstddef> // for ptrdiff_t, size_t #include <cstddef> // for ptrdiff_t, size_t
#include <utility> #include <utility>

View File

@ -17,9 +17,9 @@
#ifndef GSL_STRING_SPAN_H #ifndef GSL_STRING_SPAN_H
#define GSL_STRING_SPAN_H #define GSL_STRING_SPAN_H
#include <gsl/assert> // for Ensures, Expects #include "assert" // for Ensures, Expects
#include <gsl/span_ext> // for operator!=, operator==, dynamic_extent #include "span_ext" // for operator!=, operator==, dynamic_extent
#include <gsl/util> // for narrow_cast #include "util" // for narrow_cast
#include <algorithm> // for equal, lexicographical_compare #include <algorithm> // for equal, lexicographical_compare
#include <array> // for array #include <array> // for array

View File

@ -17,7 +17,7 @@
#ifndef GSL_UTIL_H #ifndef GSL_UTIL_H
#define GSL_UTIL_H #define GSL_UTIL_H
#include <gsl/assert> // for Expects #include "assert" // for Expects
#include <array> #include <array>
#include <cstddef> // for ptrdiff_t, size_t #include <cstddef> // for ptrdiff_t, size_t