/src/boringssl/include/openssl/span.h
Line | Count | Source |
1 | | // Copyright 2017 The BoringSSL Authors |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | | // you may not use this file except in compliance with the License. |
5 | | // You may obtain a copy of the License at |
6 | | // |
7 | | // https://www.apache.org/licenses/LICENSE-2.0 |
8 | | // |
9 | | // Unless required by applicable law or agreed to in writing, software |
10 | | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | | // See the License for the specific language governing permissions and |
13 | | // limitations under the License. |
14 | | |
15 | | #ifndef OPENSSL_HEADER_SSL_SPAN_H |
16 | | #define OPENSSL_HEADER_SSL_SPAN_H |
17 | | |
18 | | #include <openssl/base.h> // IWYU pragma: export |
19 | | |
20 | | #if !defined(BORINGSSL_NO_CXX) |
21 | | |
22 | | // Work around consumers including our headers under extern "C". |
23 | | extern "C++" { |
24 | | |
25 | | #include <stdlib.h> |
26 | | |
27 | | #include <algorithm> |
28 | | #include <array> |
29 | | #include <limits> |
30 | | #include <string_view> |
31 | | #include <type_traits> |
32 | | |
33 | | #if __has_include(<version>) |
34 | | #include <version> |
35 | | #endif |
36 | | |
37 | | #if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L |
38 | | #include <ranges> |
39 | | #endif |
40 | | |
41 | | BSSL_NAMESPACE_BEGIN |
42 | | inline constexpr size_t dynamic_extent = std::numeric_limits<size_t>::max(); |
43 | | |
44 | | template <typename T, size_t N = dynamic_extent> |
45 | | class Span; |
46 | | BSSL_NAMESPACE_END |
47 | | |
48 | | #if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 201911L |
49 | | // Mark `Span` as satisfying the `view` and `borrowed_range` concepts. This |
50 | | // should be done before the definition of `Span`, so that any inlined calls to |
51 | | // range functionality use the correct specializations. |
52 | | template <typename T, size_t N> |
53 | | inline constexpr bool std::ranges::enable_view<bssl::Span<T, N>> = true; |
54 | | template <typename T, size_t N> |
55 | | inline constexpr bool std::ranges::enable_borrowed_range<bssl::Span<T, N>> = |
56 | | true; |
57 | | #endif |
58 | | |
59 | | BSSL_NAMESPACE_BEGIN |
60 | | |
61 | | namespace internal { |
62 | | template <typename T> |
63 | | class SpanBase { |
64 | | // Put comparison operator implementations into a base class with const T, so |
65 | | // they can be used with any type that implicitly converts into a Span. |
66 | | static_assert(std::is_const_v<T>, |
67 | | "Span<T> must be derived from SpanBase<const T>"); |
68 | | |
69 | 1.72M | friend bool operator==(Span<T> lhs, Span<T> rhs) { |
70 | 1.72M | return std::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); |
71 | 1.72M | } |
72 | | |
73 | 1.26M | friend bool operator!=(Span<T> lhs, Span<T> rhs) { return !(lhs == rhs); } |
74 | | }; |
75 | | |
76 | | // Container class to store the size of a span at runtime or compile time. |
77 | | template <typename T, size_t N> |
78 | | class SpanStorage : private SpanBase<const T> { |
79 | | public: |
80 | 233k | constexpr SpanStorage(T *data, size_t size) : data_(data) { |
81 | 233k | BSSL_CHECK(size == N); |
82 | 233k | } Unexecuted instantiation: bssl::internal::SpanStorage<unsigned char const, 65ul>::SpanStorage(unsigned char const*, unsigned long) bssl::internal::SpanStorage<unsigned char const, 16ul>::SpanStorage(unsigned char const*, unsigned long) Line | Count | Source | 80 | 162 | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 162 | BSSL_CHECK(size == N); | 82 | 162 | } |
bssl::internal::SpanStorage<unsigned char, 32ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 80 | 54.3k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 54.3k | BSSL_CHECK(size == N); | 82 | 54.3k | } |
bssl::internal::SpanStorage<unsigned char, 8ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 80 | 8.99k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 8.99k | BSSL_CHECK(size == N); | 82 | 8.99k | } |
bssl::internal::SpanStorage<unsigned char const, 4ul>::SpanStorage(unsigned char const*, unsigned long) Line | Count | Source | 80 | 29.4k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 29.4k | BSSL_CHECK(size == N); | 82 | 29.4k | } |
bssl::internal::SpanStorage<unsigned char const, 6ul>::SpanStorage(unsigned char const*, unsigned long) Line | Count | Source | 80 | 7.34k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 7.34k | BSSL_CHECK(size == N); | 82 | 7.34k | } |
Unexecuted instantiation: bssl::internal::SpanStorage<ssl_cipher_st const, 25ul>::SpanStorage(ssl_cipher_st const*, unsigned long) bssl::internal::SpanStorage<unsigned short const, 3ul>::SpanStorage(unsigned short const*, unsigned long) Line | Count | Source | 80 | 10.0k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 10.0k | BSSL_CHECK(size == N); | 82 | 10.0k | } |
Unexecuted instantiation: bssl::internal::SpanStorage<bssl::NamedGroup const, 7ul>::SpanStorage(bssl::NamedGroup const*, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<char const* const, 3ul>::SpanStorage(char const* const*, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<SignatureAlgorithmName const, 17ul>::SpanStorage(SignatureAlgorithmName const*, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<bssl::VersionInfo const, 7ul>::SpanStorage(bssl::VersionInfo const*, unsigned long) bssl::internal::SpanStorage<unsigned char const, 32ul>::SpanStorage(unsigned char const*, unsigned long) Line | Count | Source | 80 | 227 | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 227 | BSSL_CHECK(size == N); | 82 | 227 | } |
bssl::internal::SpanStorage<unsigned char, 80ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 80 | 56.3k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 56.3k | BSSL_CHECK(size == N); | 82 | 56.3k | } |
bssl::internal::SpanStorage<unsigned char, 24ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 80 | 56.3k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 56.3k | BSSL_CHECK(size == N); | 82 | 56.3k | } |
Unexecuted instantiation: bssl::internal::SpanStorage<unsigned char, 64ul>::SpanStorage(unsigned char*, unsigned long) bssl::internal::SpanStorage<unsigned char, 16ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 80 | 399 | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 399 | BSSL_CHECK(size == N); | 82 | 399 | } |
bssl::internal::SpanStorage<unsigned char, 320ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 80 | 4.27k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 4.27k | BSSL_CHECK(size == N); | 82 | 4.27k | } |
bssl::internal::SpanStorage<unsigned char const, 9ul>::SpanStorage(unsigned char const*, unsigned long) Line | Count | Source | 80 | 5.85k | constexpr SpanStorage(T *data, size_t size) : data_(data) { | 81 | 5.85k | BSSL_CHECK(size == N); | 82 | 5.85k | } |
|
83 | 251k | constexpr T *data() const { return data_; }Unexecuted instantiation: bssl::internal::SpanStorage<unsigned char const, 65ul>::data() const bssl::internal::SpanStorage<unsigned char const, 16ul>::data() const Line | Count | Source | 83 | 162 | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char, 32ul>::data() const Line | Count | Source | 83 | 54.3k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char, 8ul>::data() const Line | Count | Source | 83 | 26.4k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char const, 4ul>::data() const Line | Count | Source | 83 | 29.4k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char const, 6ul>::data() const Line | Count | Source | 83 | 7.34k | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<ssl_cipher_st const, 25ul>::data() const bssl::internal::SpanStorage<unsigned short const, 3ul>::data() const Line | Count | Source | 83 | 10.0k | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<bssl::NamedGroup const, 7ul>::data() const Unexecuted instantiation: bssl::internal::SpanStorage<char const* const, 3ul>::data() const Unexecuted instantiation: bssl::internal::SpanStorage<SignatureAlgorithmName const, 17ul>::data() const Unexecuted instantiation: bssl::internal::SpanStorage<bssl::VersionInfo const, 7ul>::data() const bssl::internal::SpanStorage<unsigned char, 80ul>::data() const Line | Count | Source | 83 | 56.3k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char, 24ul>::data() const Line | Count | Source | 83 | 56.3k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char const, 32ul>::data() const Line | Count | Source | 83 | 227 | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<unsigned char, 64ul>::data() const bssl::internal::SpanStorage<unsigned char, 16ul>::data() const Line | Count | Source | 83 | 399 | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char, 320ul>::data() const Line | Count | Source | 83 | 4.27k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char const, 9ul>::data() const Line | Count | Source | 83 | 5.85k | constexpr T *data() const { return data_; } |
|
84 | 271k | constexpr size_t size() const { return N; }Unexecuted instantiation: bssl::internal::SpanStorage<unsigned char const, 65ul>::size() const bssl::internal::SpanStorage<unsigned char const, 16ul>::size() const Line | Count | Source | 84 | 162 | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char, 32ul>::size() const Line | Count | Source | 84 | 64.9k | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char, 8ul>::size() const Line | Count | Source | 84 | 26.4k | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char const, 4ul>::size() const Line | Count | Source | 84 | 31.5k | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char const, 6ul>::size() const Line | Count | Source | 84 | 14.6k | constexpr size_t size() const { return N; } |
Unexecuted instantiation: bssl::internal::SpanStorage<ssl_cipher_st const, 25ul>::size() const bssl::internal::SpanStorage<unsigned short const, 3ul>::size() const Line | Count | Source | 84 | 10.0k | constexpr size_t size() const { return N; } |
Unexecuted instantiation: bssl::internal::SpanStorage<bssl::NamedGroup const, 7ul>::size() const Unexecuted instantiation: bssl::internal::SpanStorage<char const* const, 3ul>::size() const Unexecuted instantiation: bssl::internal::SpanStorage<SignatureAlgorithmName const, 17ul>::size() const Unexecuted instantiation: bssl::internal::SpanStorage<bssl::VersionInfo const, 7ul>::size() const bssl::internal::SpanStorage<unsigned char, 80ul>::size() const Line | Count | Source | 84 | 56.3k | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char, 24ul>::size() const Line | Count | Source | 84 | 56.3k | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char const, 32ul>::size() const Line | Count | Source | 84 | 227 | constexpr size_t size() const { return N; } |
Unexecuted instantiation: bssl::internal::SpanStorage<unsigned char, 64ul>::size() const bssl::internal::SpanStorage<unsigned char, 16ul>::size() const Line | Count | Source | 84 | 399 | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char, 320ul>::size() const Line | Count | Source | 84 | 4.27k | constexpr size_t size() const { return N; } |
bssl::internal::SpanStorage<unsigned char const, 9ul>::size() const Line | Count | Source | 84 | 5.85k | constexpr size_t size() const { return N; } |
|
85 | | |
86 | | private: |
87 | | T *data_; |
88 | | }; |
89 | | |
90 | | template <typename T> |
91 | | class SpanStorage<T, dynamic_extent> : private SpanBase<const T> { |
92 | | public: |
93 | 40.7M | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {}bssl::internal::SpanStorage<unsigned char const, 18446744073709551615ul>::SpanStorage(unsigned char const*, unsigned long) Line | Count | Source | 93 | 30.7M | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<unsigned char, 18446744073709551615ul>::SpanStorage(unsigned char*, unsigned long) Line | Count | Source | 93 | 7.37M | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<unsigned short const, 18446744073709551615ul>::SpanStorage(unsigned short const*, unsigned long) Line | Count | Source | 93 | 1.55M | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<unsigned int const, 18446744073709551615ul>::SpanStorage(unsigned int const*, unsigned long) Line | Count | Source | 93 | 256k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
Unexecuted instantiation: bssl::internal::SpanStorage<ssl_cipher_st const, 18446744073709551615ul>::SpanStorage(ssl_cipher_st const*, unsigned long) bssl::internal::SpanStorage<bool const, 18446744073709551615ul>::SpanStorage(bool const*, unsigned long) Line | Count | Source | 93 | 44.1k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
Unexecuted instantiation: bssl::internal::SpanStorage<char const* const, 18446744073709551615ul>::SpanStorage(char const* const*, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<char const*, 18446744073709551615ul>::SpanStorage(char const**, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<unsigned short, 18446744073709551615ul>::SpanStorage(unsigned short*, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<bssl::NamedGroup const, 18446744073709551615ul>::SpanStorage(bssl::NamedGroup const*, unsigned long) bssl::internal::SpanStorage<int const, 18446744073709551615ul>::SpanStorage(int const*, unsigned long) Line | Count | Source | 93 | 8.94k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<char const, 18446744073709551615ul>::SpanStorage(char const*, unsigned long) Line | Count | Source | 93 | 9.14k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<crypto_iovec_st const, 18446744073709551615ul>::SpanStorage(crypto_iovec_st const*, unsigned long) Line | Count | Source | 93 | 24.8k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<crypto_ivec_st const, 18446744073709551615ul>::SpanStorage(crypto_ivec_st const*, unsigned long) Line | Count | Source | 93 | 10.4k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<crypto_iovec_st, 18446744073709551615ul>::SpanStorage(crypto_iovec_st*, unsigned long) Line | Count | Source | 93 | 4.27k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<ec_group_st const*, 18446744073709551615ul>::SpanStorage(ec_group_st const**, unsigned long) Line | Count | Source | 93 | 153k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<ec_group_st const* const, 18446744073709551615ul>::SpanStorage(ec_group_st const* const*, unsigned long) Line | Count | Source | 93 | 158k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
bssl::internal::SpanStorage<evp_pkey_alg_st const* const, 18446744073709551615ul>::SpanStorage(evp_pkey_alg_st const* const*, unsigned long) Line | Count | Source | 93 | 427k | constexpr SpanStorage(T *data, size_t size) : data_(data), size_(size) {} |
Unexecuted instantiation: bssl::internal::SpanStorage<evp_pkey_alg_st const*, 18446744073709551615ul>::SpanStorage(evp_pkey_alg_st const**, unsigned long) Unexecuted instantiation: bssl::internal::SpanStorage<unsigned long const, 18446744073709551615ul>::SpanStorage(unsigned long const*, unsigned long) Unexecuted instantiation: policy.cc:bssl::internal::SpanStorage<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::SpanStorage(bssl::(anonymous namespace)::X509PolicyNode*, unsigned long) Unexecuted instantiation: policy.cc:bssl::internal::SpanStorage<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::SpanStorage(bssl::(anonymous namespace)::X509PolicyLevel*, unsigned long) |
94 | 48.8M | constexpr T *data() const { return data_; }bssl::internal::SpanStorage<unsigned char const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 36.3M | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned char, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 6.88M | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<char const*, 18446744073709551615ul>::data() const bssl::internal::SpanStorage<unsigned short const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 3.55M | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<unsigned int const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 487k | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<ssl_cipher_st const, 18446744073709551615ul>::data() const Unexecuted instantiation: bssl::internal::SpanStorage<bssl::NamedGroup const, 18446744073709551615ul>::data() const bssl::internal::SpanStorage<bool const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 88.3k | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<char const* const, 18446744073709551615ul>::data() const Unexecuted instantiation: bssl::internal::SpanStorage<unsigned short, 18446744073709551615ul>::data() const bssl::internal::SpanStorage<int const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 7.73k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<char const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 4.57k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<crypto_iovec_st const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 245k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<crypto_ivec_st const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 96.4k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<crypto_iovec_st, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 21.3k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<ec_group_st const*, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 153k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<ec_group_st const* const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 269k | constexpr T *data() const { return data_; } |
bssl::internal::SpanStorage<evp_pkey_alg_st const* const, 18446744073709551615ul>::data() const Line | Count | Source | 94 | 676k | constexpr T *data() const { return data_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<evp_pkey_alg_st const*, 18446744073709551615ul>::data() const Unexecuted instantiation: bssl::internal::SpanStorage<unsigned long const, 18446744073709551615ul>::data() const Unexecuted instantiation: policy.cc:bssl::internal::SpanStorage<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::data() const Unexecuted instantiation: policy.cc:bssl::internal::SpanStorage<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::data() const |
95 | 80.7M | constexpr size_t size() const { return size_; }bssl::internal::SpanStorage<unsigned char const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 64.1M | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<unsigned char, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 11.7M | constexpr size_t size() const { return size_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<char const*, 18446744073709551615ul>::size() const bssl::internal::SpanStorage<unsigned short const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 3.12M | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<unsigned int const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 514k | constexpr size_t size() const { return size_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<ssl_cipher_st const, 18446744073709551615ul>::size() const Unexecuted instantiation: bssl::internal::SpanStorage<bssl::NamedGroup const, 18446744073709551615ul>::size() const bssl::internal::SpanStorage<bool const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 110k | constexpr size_t size() const { return size_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<char const* const, 18446744073709551615ul>::size() const Unexecuted instantiation: bssl::internal::SpanStorage<unsigned short, 18446744073709551615ul>::size() const bssl::internal::SpanStorage<int const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 31.2k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<char const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 4.57k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<crypto_iovec_st const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 252k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<crypto_ivec_st const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 64.6k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<crypto_iovec_st, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 51.3k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<ec_group_st const*, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 153k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<ec_group_st const* const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 134k | constexpr size_t size() const { return size_; } |
bssl::internal::SpanStorage<evp_pkey_alg_st const* const, 18446744073709551615ul>::size() const Line | Count | Source | 95 | 427k | constexpr size_t size() const { return size_; } |
Unexecuted instantiation: bssl::internal::SpanStorage<evp_pkey_alg_st const*, 18446744073709551615ul>::size() const Unexecuted instantiation: bssl::internal::SpanStorage<unsigned long const, 18446744073709551615ul>::size() const Unexecuted instantiation: policy.cc:bssl::internal::SpanStorage<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::size() const Unexecuted instantiation: policy.cc:bssl::internal::SpanStorage<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::size() const |
96 | | |
97 | | private: |
98 | | T *data_; |
99 | | size_t size_; |
100 | | }; |
101 | | |
102 | | // Heuristically test whether C is a container type that can be converted into |
103 | | // a Span<T> by checking for data() and size() member functions. |
104 | | template <typename C, typename T> |
105 | | using EnableIfContainer = std::enable_if_t< |
106 | | std::is_convertible_v<decltype(std::declval<C>().data()), T *> && |
107 | | std::is_integral_v<decltype(std::declval<C>().size())>>; |
108 | | |
109 | | // A fake type used to be able to SFINAE between two different container |
110 | | // constructors - by giving one this as a second default argument, and one not. |
111 | | struct AllowRedeclaringConstructor {}; |
112 | | |
113 | | } // namespace internal |
114 | | |
115 | | // A Span<T> is a non-owning reference to a contiguous array of objects of type |
116 | | // `T`. Conceptually, a Span is a simple a pointer to `T` and a count of |
117 | | // elements accessible via that pointer. The elements referenced by the Span can |
118 | | // be mutated if `T` is mutable. |
119 | | // |
120 | | // A Span can be constructed from container types implementing `data()` and |
121 | | // `size()` methods. If `T` is constant, construction from a container type is |
122 | | // implicit. This allows writing methods that accept data from some unspecified |
123 | | // container type: |
124 | | // |
125 | | // // Foo views data referenced by v. |
126 | | // void Foo(bssl::Span<const uint8_t> v) { ... } |
127 | | // |
128 | | // std::vector<uint8_t> vec; |
129 | | // Foo(vec); |
130 | | // |
131 | | // For mutable Spans, conversion is explicit: |
132 | | // |
133 | | // // FooMutate mutates data referenced by v. |
134 | | // void FooMutate(bssl::Span<uint8_t> v) { ... } |
135 | | // |
136 | | // FooMutate(bssl::Span<uint8_t>(vec)); |
137 | | // |
138 | | // You can also use C++17 class template argument deduction to construct Spans |
139 | | // in order to deduce the type of the Span automatically. |
140 | | // |
141 | | // FooMutate(bssl::Span(vec)); |
142 | | // |
143 | | // Note that Spans have value type semantics. They are cheap to construct and |
144 | | // copy, and should be passed by value whenever a method would otherwise accept |
145 | | // a reference or pointer to a container or array. |
146 | | template <typename T, size_t N> |
147 | | class Span : public internal::SpanStorage<T, N> { |
148 | | public: |
149 | | using element_type = T; |
150 | | using value_type = std::remove_cv_t<T>; |
151 | | using size_type = size_t; |
152 | | using difference_type = ptrdiff_t; |
153 | | using pointer = T *; |
154 | | using const_pointer = const T *; |
155 | | using reference = T &; |
156 | | using const_reference = const T &; |
157 | | using iterator = T *; |
158 | | using const_iterator = const T *; |
159 | | |
160 | | template <typename U = T, |
161 | | typename = std::enable_if_t<N == 0 || N == dynamic_extent, U>> |
162 | 6.01M | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {}bssl::Span<unsigned char const, 18446744073709551615ul>::Span<unsigned char const, unsigned char const>() Line | Count | Source | 162 | 3.88M | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span<unsigned short const, unsigned short const>() Line | Count | Source | 162 | 52.4k | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {} |
bssl::Span<unsigned int const, 18446744073709551615ul>::Span<unsigned int const, unsigned int const>() Line | Count | Source | 162 | 13.0k | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span<unsigned char, unsigned char>() Line | Count | Source | 162 | 2.05M | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {} |
Unexecuted instantiation: bssl::Span<char const* const, 18446744073709551615ul>::Span<char const* const, char const* const>() bssl::Span<char const, 18446744073709551615ul>::Span<char const, char const>() Line | Count | Source | 162 | 4.57k | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {} |
bssl::Span<ec_group_st const* const, 18446744073709551615ul>::Span<ec_group_st const* const, ec_group_st const* const>() Line | Count | Source | 162 | 3.18k | constexpr Span() : internal::SpanStorage<T, N>(nullptr, 0) {} |
|
163 | | |
164 | | // NOTE: This constructor may abort() at runtime if len differs from the |
165 | | // compile-time size, if any. |
166 | 24.6M | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {}bssl::Span<unsigned char const, 18446744073709551615ul>::Span(unsigned char const*, unsigned long) Line | Count | Source | 166 | 18.6M | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span(unsigned char*, unsigned long) Line | Count | Source | 166 | 4.84M | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 65ul>::Span(unsigned char const*, unsigned long) bssl::Span<unsigned char const, 16ul>::Span(unsigned char const*, unsigned long) Line | Count | Source | 166 | 162 | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span(unsigned short const*, unsigned long) Line | Count | Source | 166 | 416k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<unsigned char, 8ul>::Span(unsigned char*, unsigned long) Line | Count | Source | 166 | 8.99k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<bool const, 18446744073709551615ul>::Span(bool const*, unsigned long) Line | Count | Source | 166 | 22.0k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
Unexecuted instantiation: bssl::Span<char const* const, 18446744073709551615ul>::Span(char const* const*, unsigned long) Unexecuted instantiation: bssl::Span<char const*, 18446744073709551615ul>::Span(char const**, unsigned long) Unexecuted instantiation: bssl::Span<unsigned short, 18446744073709551615ul>::Span(unsigned short*, unsigned long) bssl::Span<unsigned int const, 18446744073709551615ul>::Span(unsigned int const*, unsigned long) Line | Count | Source | 166 | 121k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<int const, 18446744073709551615ul>::Span(int const*, unsigned long) Line | Count | Source | 166 | 8.94k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<unsigned char const, 4ul>::Span(unsigned char const*, unsigned long) Line | Count | Source | 166 | 27.4k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::Span(crypto_iovec_st const*, unsigned long) Line | Count | Source | 166 | 20.5k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::Span(crypto_ivec_st const*, unsigned long) Line | Count | Source | 166 | 10.4k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
Unexecuted instantiation: bssl::Span<crypto_iovec_st, 18446744073709551615ul>::Span(crypto_iovec_st*, unsigned long) bssl::Span<ec_group_st const*, 18446744073709551615ul>::Span(ec_group_st const**, unsigned long) Line | Count | Source | 166 | 153k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::Span(evp_pkey_alg_st const* const*, unsigned long) Line | Count | Source | 166 | 427k | constexpr Span(T *ptr, size_t len) : internal::SpanStorage<T, N>(ptr, len) {} |
Unexecuted instantiation: bssl::Span<evp_pkey_alg_st const*, 18446744073709551615ul>::Span(evp_pkey_alg_st const**, unsigned long) |
167 | | |
168 | | template <size_t NA, |
169 | | typename = std::enable_if_t<N == NA || N == dynamic_extent>> |
170 | | // NOLINTNEXTLINE(google-explicit-constructor): same as std::span. |
171 | 1.22M | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {}bssl::Span<unsigned char const, 18446744073709551615ul>::Span<1ul, void>(unsigned char const (&) [1ul]) Line | Count | Source | 171 | 90.0k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span<9ul, void>(unsigned short const (&) [9ul]) Line | Count | Source | 171 | 98.2k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span<64ul, void>(unsigned char (&) [64ul]) Line | Count | Source | 171 | 312 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char, 18446744073709551615ul>::Span<65ul, void>(unsigned char (&) [65ul]) bssl::Span<unsigned char, 18446744073709551615ul>::Span<32ul, void>(unsigned char (&) [32ul]) Line | Count | Source | 171 | 20.9k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<32ul, void>(unsigned char const (&) [32ul]) Line | Count | Source | 171 | 97.9k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<2ul, void>(unsigned char const (&) [2ul]) Line | Count | Source | 171 | 32.5k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<16ul, void>(unsigned char const (&) [16ul]) Line | Count | Source | 171 | 162 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span<2ul, void>(unsigned short const (&) [2ul]) Line | Count | Source | 171 | 7.37k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span<15ul, void>(unsigned short const (&) [15ul]) Line | Count | Source | 171 | 26.2k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char, 18446744073709551615ul>::Span<8ul, void>(unsigned char (&) [8ul]) bssl::Span<unsigned short const, 18446744073709551615ul>::Span<3ul, void>(unsigned short const (&) [3ul]) Line | Count | Source | 171 | 100k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span<1568ul, void>(unsigned char (&) [1568ul]) Line | Count | Source | 171 | 52.6k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 32ul>::Span<32ul, void>(unsigned char (&) [32ul]) Line | Count | Source | 171 | 54.3k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<8ul, void>(unsigned char const (&) [8ul]) Line | Count | Source | 171 | 37.2k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 4ul>::Span<4ul, void>(unsigned char const (&) [4ul]) Line | Count | Source | 171 | 2.03k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 6ul>::Span<6ul, void>(unsigned char const (&) [6ul]) Line | Count | Source | 171 | 7.34k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 18446744073709551615ul>::Span<25ul, void>(ssl_cipher_st const (&) [25ul]) Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 25ul>::Span<25ul, void>(ssl_cipher_st const (&) [25ul]) Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 18446744073709551615ul>::Span<7ul, void>(bssl::NamedGroup const (&) [7ul]) bssl::Span<unsigned short const, 3ul>::Span<3ul, void>(unsigned short const (&) [3ul]) Line | Count | Source | 171 | 10.0k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 7ul>::Span<7ul, void>(bssl::NamedGroup const (&) [7ul]) Unexecuted instantiation: bssl::Span<char const* const, 3ul>::Span<3ul, void>(char const* const (&) [3ul]) Unexecuted instantiation: bssl::Span<SignatureAlgorithmName const, 17ul>::Span<17ul, void>(SignatureAlgorithmName const (&) [17ul]) bssl::Span<unsigned char const, 18446744073709551615ul>::Span<4ul, void>(unsigned char const (&) [4ul]) Line | Count | Source | 171 | 28.7k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span<4ul, void>(unsigned short const (&) [4ul]) Line | Count | Source | 171 | 320k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<bssl::VersionInfo const, 7ul>::Span<7ul, void>(bssl::VersionInfo const (&) [7ul]) bssl::Span<char const, 18446744073709551615ul>::Span<34ul, void>(char const (&) [34ul]) Line | Count | Source | 171 | 4.56k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<char const, 18446744073709551615ul>::Span<20ul, void>(char const (&) [20ul]) Line | Count | Source | 171 | 8 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char, 8ul>::Span<8ul, void>(unsigned char (&) [8ul]) bssl::Span<unsigned char const, 32ul>::Span<32ul, void>(unsigned char const (&) [32ul]) Line | Count | Source | 171 | 227 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 80ul>::Span<80ul, void>(unsigned char (&) [80ul]) Line | Count | Source | 171 | 56.3k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 24ul>::Span<24ul, void>(unsigned char (&) [24ul]) Line | Count | Source | 171 | 56.3k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span<2ul, void>(unsigned char (&) [2ul]) Line | Count | Source | 171 | 91.8k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char, 64ul>::Span<64ul, void>(unsigned char (&) [64ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<12ul, void>(unsigned char const (&) [12ul]) bssl::Span<unsigned char, 16ul>::Span<16ul, void>(unsigned char (&) [16ul]) Line | Count | Source | 171 | 399 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<1952ul, void>(unsigned char const (&) [1952ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<4032ul, void>(unsigned char const (&) [4032ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<3309ul, void>(unsigned char const (&) [3309ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<2400ul, void>(unsigned char const (&) [2400ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<1184ul, void>(unsigned char const (&) [1184ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<1088ul, void>(unsigned char const (&) [1088ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<64ul, void>(unsigned char const (&) [64ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<48ul, void>(unsigned char const (&) [48ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<20ul, void>(unsigned char const (&) [20ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<296ul, void>(unsigned char const (&) [296ul]) bssl::Span<unsigned char const, 18446744073709551615ul>::Span<3ul, void>(unsigned char const (&) [3ul]) Line | Count | Source | 171 | 7.55k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<128ul, void>(unsigned char const (&) [128ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<256ul, void>(unsigned char const (&) [256ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<65ul, void>(unsigned char const (&) [65ul]) bssl::Span<unsigned char, 18446744073709551615ul>::Span<12ul, void>(unsigned char (&) [12ul]) Line | Count | Source | 171 | 1.49k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char, 320ul>::Span<320ul, void>(unsigned char (&) [320ul]) Line | Count | Source | 171 | 4.27k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 9ul>::Span<9ul, void>(unsigned char const (&) [9ul]) Line | Count | Source | 171 | 5.85k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::Span<4ul, void>(evp_pkey_alg_st const* const (&) [4ul]) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<54ul, void>(unsigned char const (&) [54ul]) bssl::Span<unsigned char const, 18446744073709551615ul>::Span<9ul, void>(unsigned char const (&) [9ul]) Line | Count | Source | 171 | 7.19k | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::Span<24ul, void>(unsigned long const (&) [24ul]) Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::Span<32ul, void>(unsigned long const (&) [32ul]) Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::Span<48ul, void>(unsigned long const (&) [48ul]) Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::Span<64ul, void>(unsigned long const (&) [64ul]) Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::Span<96ul, void>(unsigned long const (&) [96ul]) Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::Span<128ul, void>(unsigned long const (&) [128ul]) bssl::Span<unsigned char const, 18446744073709551615ul>::Span<5ul, void>(unsigned char const (&) [5ul]) Line | Count | Source | 171 | 839 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<7ul, void>(unsigned char const (&) [7ul]) Line | Count | Source | 171 | 733 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<10ul, void>(unsigned char const (&) [10ul]) Line | Count | Source | 171 | 373 | constexpr Span(T (&array)[NA]) : internal::SpanStorage<T, N>(array, NA) {} |
|
172 | | |
173 | | // TODO(crbug.com/457351017): Add tests for these c'tors. |
174 | | template <size_t NA, typename U, |
175 | | typename = internal::EnableIfContainer<std::array<U, NA>, T>, |
176 | | typename = std::enable_if_t<N == NA || N == dynamic_extent>> |
177 | | // NOLINTNEXTLINE(google-explicit-constructor): same as std::span. |
178 | | constexpr Span(std::array<U, NA> &array) |
179 | | : internal::SpanStorage<T, N>(array.data(), NA) {} |
180 | | |
181 | | template <size_t NA, typename U, |
182 | | typename = internal::EnableIfContainer<const std::array<U, NA>, T>, |
183 | | typename = std::enable_if_t<N == NA || N == dynamic_extent>> |
184 | | // NOLINTNEXTLINE(google-explicit-constructor): same as std::span. |
185 | | constexpr Span(const std::array<U, NA> &array) |
186 | 1.90k | : internal::SpanStorage<T, N>(array.data(), NA) {}bssl::Span<ec_group_st const* const, 18446744073709551615ul>::Span<4ul, ec_group_st const*, void, void>(std::__1::array<ec_group_st const*, 4ul> const&) Line | Count | Source | 186 | 1.90k | : internal::SpanStorage<T, N>(array.data(), NA) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<5ul, unsigned char, void, void>(std::__1::array<unsigned char, 5ul> const&) Unexecuted instantiation: bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::Span<13ul, evp_pkey_alg_st const*, void, void>(std::__1::array<evp_pkey_alg_st const*, 13ul> const&) |
187 | | |
188 | | template < |
189 | | size_t NA, typename U, |
190 | | typename = std::enable_if_t<std::is_convertible_v<U (*)[], T (*)[]>>, |
191 | | typename = std::enable_if_t<N == dynamic_extent || N == NA>> |
192 | | // NOLINTNEXTLINE(google-explicit-constructor): same as std::span. |
193 | | constexpr Span(Span<U, NA> other) |
194 | 4.77M | : internal::SpanStorage<T, N>(other.data(), other.size()) {}bssl::Span<unsigned char const, 18446744073709551615ul>::Span<18446744073709551615ul, unsigned char, void, void>(bssl::Span<unsigned char, 18446744073709551615ul>) Line | Count | Source | 194 | 4.56M | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<65ul, unsigned char const, void, void>(bssl::Span<unsigned char const, 65ul>) bssl::Span<unsigned char const, 18446744073709551615ul>::Span<16ul, unsigned char const, void, void>(bssl::Span<unsigned char const, 16ul>) Line | Count | Source | 194 | 162 | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<8ul, unsigned char, void, void>(bssl::Span<unsigned char, 8ul>) Line | Count | Source | 194 | 26.1k | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
Unexecuted instantiation: bssl::Span<unsigned short const, 18446744073709551615ul>::Span<18446744073709551615ul, unsigned short, void, void>(bssl::Span<unsigned short, 18446744073709551615ul>) bssl::Span<unsigned short const, 18446744073709551615ul>::Span<3ul, unsigned short const, void, void>(bssl::Span<unsigned short const, 3ul>) Line | Count | Source | 194 | 10.0k | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<4ul, unsigned char const, void, void>(bssl::Span<unsigned char const, 4ul>) Line | Count | Source | 194 | 27.2k | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span<8ul, unsigned char, void, void>(bssl::Span<unsigned char, 8ul>) Line | Count | Source | 194 | 227 | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
bssl::Span<ec_group_st const* const, 18446744073709551615ul>::Span<18446744073709551615ul, ec_group_st const*, void, void>(bssl::Span<ec_group_st const*, 18446744073709551615ul>) Line | Count | Source | 194 | 153k | : internal::SpanStorage<T, N>(other.data(), other.size()) {} |
Unexecuted instantiation: bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::Span<18446744073709551615ul, evp_pkey_alg_st const*, void, void>(bssl::Span<evp_pkey_alg_st const*, 18446744073709551615ul>) |
195 | | |
196 | | template <typename C, typename = internal::EnableIfContainer<C, T>, |
197 | | typename = std::enable_if_t<std::is_const_v<T>, C>, |
198 | | typename = std::enable_if_t<N == dynamic_extent, C>> |
199 | | // NOLINTNEXTLINE(google-explicit-constructor): same as std::span. |
200 | | constexpr Span(const C &container) |
201 | 4.02M | : internal::SpanStorage<T, N>(container.data(), container.size()) {}bssl::Span<unsigned char const, 18446744073709551615ul>::Span<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, void, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >(std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > const&) Line | Count | Source | 201 | 7.37k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::Array<unsigned char>, void, bssl::Array<unsigned char>, bssl::Array<unsigned char> >(bssl::Array<unsigned char> const&) Line | Count | Source | 201 | 1.62M | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned short const, 18446744073709551615ul>::Span<bssl::Array<unsigned short>, void, bssl::Array<unsigned short>, bssl::Array<unsigned short> >(bssl::Array<unsigned short> const&) Line | Count | Source | 201 | 473k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned int const, 18446744073709551615ul>::Span<bssl::Array<unsigned int>, void, bssl::Array<unsigned int>, bssl::Array<unsigned int> >(bssl::Array<unsigned int> const&) Line | Count | Source | 201 | 121k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned char, 2ul>, void, bssl::InplaceVector<unsigned char, 2ul>, bssl::InplaceVector<unsigned char, 2ul> >(bssl::InplaceVector<unsigned char, 2ul> const&) Line | Count | Source | 201 | 243k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
Unexecuted instantiation: bssl::Span<unsigned short const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned short, 7ul>, void, bssl::InplaceVector<unsigned short, 7ul>, bssl::InplaceVector<unsigned short, 7ul> >(bssl::InplaceVector<unsigned short, 7ul> const&) bssl::Span<unsigned short const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned short, 2ul>, void, bssl::InplaceVector<unsigned short, 2ul>, bssl::InplaceVector<unsigned short, 2ul> >(bssl::InplaceVector<unsigned short, 2ul> const&) Line | Count | Source | 201 | 52.6k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned char, 48ul>, void, bssl::InplaceVector<unsigned char, 48ul>, bssl::InplaceVector<unsigned char, 48ul> >(bssl::InplaceVector<unsigned char, 48ul> const&) Line | Count | Source | 201 | 433k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned char, 32ul>, void, bssl::InplaceVector<unsigned char, 32ul>, bssl::InplaceVector<unsigned char, 32ul> >(bssl::InplaceVector<unsigned char, 32ul> const&) Line | Count | Source | 201 | 792k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<bool const, 18446744073709551615ul>::Span<bssl::Array<bool>, void, bssl::Array<bool>, bssl::Array<bool> >(bssl::Array<bool> const&) Line | Count | Source | 201 | 22.0k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned char, 12ul>, void, bssl::InplaceVector<unsigned char, 12ul>, bssl::InplaceVector<unsigned char, 12ul> >(bssl::InplaceVector<unsigned char, 12ul> const&) Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned char, 64ul>, void, bssl::InplaceVector<unsigned char, 64ul>, bssl::InplaceVector<unsigned char, 64ul> >(bssl::InplaceVector<unsigned char, 64ul> const&) bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::Span<bssl::InplaceVector<crypto_iovec_st, 16ul>, void, bssl::InplaceVector<crypto_iovec_st, 16ul>, bssl::InplaceVector<crypto_iovec_st, 16ul> >(bssl::InplaceVector<crypto_iovec_st, 16ul> const&) Line | Count | Source | 201 | 4.27k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::Vector<unsigned char>, void, bssl::Vector<unsigned char>, bssl::Vector<unsigned char> >(bssl::Vector<unsigned char> const&) bssl::Span<unsigned char const, 18446744073709551615ul>::Span<bssl::der::Input, void, bssl::der::Input, bssl::der::Input>(bssl::der::Input const&) Line | Count | Source | 201 | 247k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
|
202 | | |
203 | | // NOTE: This constructor may abort() at runtime if the container's length |
204 | | // differs from the compile-time size, if any. |
205 | | template <typename C, typename = internal::EnableIfContainer<C, T>, |
206 | | typename = std::enable_if_t<std::is_const_v<T>, C>, |
207 | | typename = std::enable_if_t<N != dynamic_extent, C>> |
208 | | constexpr explicit Span(const C &container, |
209 | | internal::AllowRedeclaringConstructor = {}) |
210 | | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
211 | | |
212 | | // NOTE: This constructor may abort() at runtime if the container's length |
213 | | // differs from the compile-time size, if any. |
214 | | template <typename C, typename = internal::EnableIfContainer<C, T>, |
215 | | typename = std::enable_if_t<!std::is_const_v<T>, C>> |
216 | | constexpr explicit Span(C &container) |
217 | 303k | : internal::SpanStorage<T, N>(container.data(), container.size()) {}bssl::Span<unsigned char, 18446744073709551615ul>::Span<bssl::Array<unsigned char>, void, bssl::Array<unsigned char> >(bssl::Array<unsigned char>&) Line | Count | Source | 217 | 134k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<unsigned char, 18446744073709551615ul>::Span<bssl::InplaceVector<unsigned char, 48ul>, void, bssl::InplaceVector<unsigned char, 48ul> >(bssl::InplaceVector<unsigned char, 48ul>&) Line | Count | Source | 217 | 165k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
bssl::Span<crypto_iovec_st, 18446744073709551615ul>::Span<bssl::InplaceVector<crypto_iovec_st, 16ul>, void, bssl::InplaceVector<crypto_iovec_st, 16ul> >(bssl::InplaceVector<crypto_iovec_st, 16ul>&) Line | Count | Source | 217 | 4.27k | : internal::SpanStorage<T, N>(container.data(), container.size()) {} |
Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::Span<bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>, void, bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode> >(bssl::Vector<bssl::(anonymous namespace)::X509PolicyNode>&) Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::Span<bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>, void, bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel> >(bssl::Vector<bssl::(anonymous namespace)::X509PolicyLevel>&) |
218 | | |
219 | | using internal::SpanStorage<T, N>::data; |
220 | | using internal::SpanStorage<T, N>::size; |
221 | 11.2M | constexpr bool empty() const { return size() == 0; }bssl::Span<unsigned char const, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 9.01M | constexpr bool empty() const { return size() == 0; } |
Unexecuted instantiation: bssl::Span<char const*, 18446744073709551615ul>::empty() const bssl::Span<unsigned int const, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 27.1k | constexpr bool empty() const { return size() == 0; } |
bssl::Span<unsigned short const, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 84.0k | constexpr bool empty() const { return size() == 0; } |
bssl::Span<unsigned char, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 2.08M | constexpr bool empty() const { return size() == 0; } |
bssl::Span<int const, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 8.94k | constexpr bool empty() const { return size() == 0; } |
Unexecuted instantiation: bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::empty() const bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 17.3k | constexpr bool empty() const { return size() == 0; } |
bssl::Span<crypto_iovec_st, 18446744073709551615ul>::empty() const Line | Count | Source | 221 | 8.55k | constexpr bool empty() const { return size() == 0; } |
Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::empty() const |
222 | | |
223 | 8.12M | constexpr iterator begin() const { return data(); }bssl::Span<unsigned char const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 6.31M | constexpr iterator begin() const { return data(); } |
bssl::Span<unsigned short const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 1.14M | constexpr iterator begin() const { return data(); } |
Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 18446744073709551615ul>::begin() const Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 18446744073709551615ul>::begin() const bssl::Span<bool const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 22.0k | constexpr iterator begin() const { return data(); } |
bssl::Span<unsigned int const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 121k | constexpr iterator begin() const { return data(); } |
bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 80.2k | constexpr iterator begin() const { return data(); } |
bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 46.7k | constexpr iterator begin() const { return data(); } |
bssl::Span<unsigned char, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 13.2k | constexpr iterator begin() const { return data(); } |
Unexecuted instantiation: bssl::Span<crypto_iovec_st, 18446744073709551615ul>::begin() const bssl::Span<ec_group_st const* const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 134k | constexpr iterator begin() const { return data(); } |
bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::begin() const Line | Count | Source | 223 | 248k | constexpr iterator begin() const { return data(); } |
Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::begin() const |
224 | | constexpr const_iterator cbegin() const { return data(); } |
225 | 8.28M | constexpr iterator end() const { return data() + size(); }bssl::Span<unsigned char const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 6.33M | constexpr iterator end() const { return data() + size(); } |
bssl::Span<unsigned short const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 1.30M | constexpr iterator end() const { return data() + size(); } |
Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 18446744073709551615ul>::end() const Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 18446744073709551615ul>::end() const bssl::Span<bool const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 22.0k | constexpr iterator end() const { return data() + size(); } |
bssl::Span<unsigned int const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 121k | constexpr iterator end() const { return data() + size(); } |
bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 80.2k | constexpr iterator end() const { return data() + size(); } |
bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 46.7k | constexpr iterator end() const { return data() + size(); } |
Unexecuted instantiation: bssl::Span<crypto_iovec_st, 18446744073709551615ul>::end() const bssl::Span<ec_group_st const* const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 134k | constexpr iterator end() const { return data() + size(); } |
bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::end() const Line | Count | Source | 225 | 248k | constexpr iterator end() const { return data() + size(); } |
Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::end() const |
226 | | constexpr const_iterator cend() const { return end(); } |
227 | | |
228 | 10.8k | constexpr T &front() const { |
229 | 10.8k | BSSL_CHECK(size() != 0); |
230 | 10.8k | return data()[0]; |
231 | 10.8k | } bssl::Span<unsigned char const, 18446744073709551615ul>::front() const Line | Count | Source | 228 | 5.05k | constexpr T &front() const { | 229 | 5.05k | BSSL_CHECK(size() != 0); | 230 | 5.05k | return data()[0]; | 231 | 5.05k | } |
Unexecuted instantiation: bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::front() const bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::front() const Line | Count | Source | 228 | 5.79k | constexpr T &front() const { | 229 | 5.79k | BSSL_CHECK(size() != 0); | 230 | 5.79k | return data()[0]; | 231 | 5.79k | } |
|
232 | 160k | constexpr T &back() const { |
233 | 160k | BSSL_CHECK(size() != 0); |
234 | 160k | return data()[size() - 1]; |
235 | 160k | } bssl::Span<unsigned char const, 18446744073709551615ul>::back() const Line | Count | Source | 232 | 8.23k | constexpr T &back() const { | 233 | 8.23k | BSSL_CHECK(size() != 0); | 234 | 8.23k | return data()[size() - 1]; | 235 | 8.23k | } |
Unexecuted instantiation: bssl::Span<unsigned int const, 18446744073709551615ul>::back() const bssl::Span<unsigned char, 18446744073709551615ul>::back() const Line | Count | Source | 232 | 124k | constexpr T &back() const { | 233 | 124k | BSSL_CHECK(size() != 0); | 234 | 124k | return data()[size() - 1]; | 235 | 124k | } |
bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::back() const Line | Count | Source | 232 | 5.79k | constexpr T &back() const { | 233 | 5.79k | BSSL_CHECK(size() != 0); | 234 | 5.79k | return data()[size() - 1]; | 235 | 5.79k | } |
bssl::Span<crypto_iovec_st, 18446744073709551615ul>::back() const Line | Count | Source | 232 | 21.3k | constexpr T &back() const { | 233 | 21.3k | BSSL_CHECK(size() != 0); | 234 | 21.3k | return data()[size() - 1]; | 235 | 21.3k | } |
Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::back() const |
236 | | |
237 | 1.31M | constexpr T &operator[](size_t i) const { |
238 | 1.31M | BSSL_CHECK(i < size()); |
239 | 1.31M | return data()[i]; |
240 | 1.31M | } bssl::Span<unsigned char const, 18446744073709551615ul>::operator[](unsigned long) const Line | Count | Source | 237 | 533k | constexpr T &operator[](size_t i) const { | 238 | 533k | BSSL_CHECK(i < size()); | 239 | 533k | return data()[i]; | 240 | 533k | } |
Unexecuted instantiation: bssl::Span<char const*, 18446744073709551615ul>::operator[](unsigned long) const bssl::Span<unsigned short const, 18446744073709551615ul>::operator[](unsigned long) const Line | Count | Source | 237 | 322k | constexpr T &operator[](size_t i) const { | 238 | 322k | BSSL_CHECK(i < size()); | 239 | 322k | return data()[i]; | 240 | 322k | } |
Unexecuted instantiation: bssl::Span<unsigned int const, 18446744073709551615ul>::operator[](unsigned long) const bssl::Span<unsigned char, 18446744073709551615ul>::operator[](unsigned long) const Line | Count | Source | 237 | 389k | constexpr T &operator[](size_t i) const { | 238 | 389k | BSSL_CHECK(i < size()); | 239 | 389k | return data()[i]; | 240 | 389k | } |
Unexecuted instantiation: bssl::Span<char const* const, 18446744073709551615ul>::operator[](unsigned long) const Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 25ul>::operator[](unsigned long) const Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 7ul>::operator[](unsigned long) const bssl::Span<int const, 18446744073709551615ul>::operator[](unsigned long) const Line | Count | Source | 237 | 7.73k | constexpr T &operator[](size_t i) const { | 238 | 7.73k | BSSL_CHECK(i < size()); | 239 | 7.73k | return data()[i]; | 240 | 7.73k | } |
Unexecuted instantiation: bssl::Span<char const* const, 3ul>::operator[](unsigned long) const Unexecuted instantiation: bssl::Span<SignatureAlgorithmName const, 17ul>::operator[](unsigned long) const Unexecuted instantiation: bssl::Span<bssl::VersionInfo const, 7ul>::operator[](unsigned long) const bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::operator[](unsigned long) const Line | Count | Source | 237 | 58.9k | constexpr T &operator[](size_t i) const { | 238 | 58.9k | BSSL_CHECK(i < size()); | 239 | 58.9k | return data()[i]; | 240 | 58.9k | } |
bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::operator[](unsigned long) const Line | Count | Source | 237 | 2.99k | constexpr T &operator[](size_t i) const { | 238 | 2.99k | BSSL_CHECK(i < size()); | 239 | 2.99k | return data()[i]; | 240 | 2.99k | } |
Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::operator[](unsigned long) const |
241 | | T &at(size_t i) const { return (*this)[i]; } |
242 | | |
243 | | private: |
244 | 27.2k | static constexpr size_t SubspanOutLen(size_t size, size_t pos, size_t len) { |
245 | 27.2k | return len != dynamic_extent ? len : size - pos; |
246 | 27.2k | } |
247 | | static constexpr size_t SubspanTypeOutLen(size_t size, size_t pos, |
248 | 0 | size_t len) { |
249 | 0 | // This differs from SubspanOutLen in that if both size and len are |
250 | 0 | // dynamic_extent, dynamic_extent will be returned. |
251 | 0 | return len != dynamic_extent |
252 | 0 | ? len |
253 | 0 | : (size != dynamic_extent ? size - pos : dynamic_extent); |
254 | 0 | } Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<char const*, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned short const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned int const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char const, 65ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char const, 16ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 32ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 8ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char const, 4ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char const, 6ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<bool const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<char const* const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<ssl_cipher_st const, 25ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned short, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned short const, 3ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<bssl::NamedGroup const, 7ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<int const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<char const* const, 3ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<SignatureAlgorithmName const, 17ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<bssl::VersionInfo const, 7ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<char const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char const, 32ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 80ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 24ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<crypto_iovec_st, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 64ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 16ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char, 320ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned char const, 9ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<ec_group_st const* const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<ec_group_st const*, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<evp_pkey_alg_st const* const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<evp_pkey_alg_st const*, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: bssl::Span<unsigned long const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyNode const, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyNode, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) Unexecuted instantiation: policy.cc:bssl::Span<bssl::(anonymous namespace)::X509PolicyLevel, 18446744073709551615ul>::SubspanTypeOutLen(unsigned long, unsigned long, unsigned long) |
255 | | |
256 | | public: |
257 | | // NOTE: This method may abort() at runtime if pos or len are out of range. |
258 | | // NOTE: As opposed to std::span, the `dynamic_extent` value of `len` is not |
259 | | // magical here. This gets rid of a lot of runtime checks. |
260 | 553k | constexpr Span<T> subspan(size_t pos, size_t len) const { |
261 | | // absl::Span throws an exception here. Note std::span and Chromium |
262 | | // base::span forbid pos + len being out of range, with a special case at |
263 | | // npos/dynamic_extent, whereas absl::Span::subspan clips the span. This |
264 | | // implements the std::span behavior which is more strict. |
265 | 553k | BSSL_CHECK(pos <= size()); |
266 | 553k | BSSL_CHECK(len <= size() - pos); |
267 | 553k | return Span<T>(data() + pos, len); |
268 | 553k | } bssl::Span<unsigned char const, 18446744073709551615ul>::subspan(unsigned long, unsigned long) const Line | Count | Source | 260 | 284k | constexpr Span<T> subspan(size_t pos, size_t len) const { | 261 | | // absl::Span throws an exception here. Note std::span and Chromium | 262 | | // base::span forbid pos + len being out of range, with a special case at | 263 | | // npos/dynamic_extent, whereas absl::Span::subspan clips the span. This | 264 | | // implements the std::span behavior which is more strict. | 265 | 284k | BSSL_CHECK(pos <= size()); | 266 | 284k | BSSL_CHECK(len <= size() - pos); | 267 | 284k | return Span<T>(data() + pos, len); | 268 | 284k | } |
bssl::Span<unsigned char, 18446744073709551615ul>::subspan(unsigned long, unsigned long) const Line | Count | Source | 260 | 269k | constexpr Span<T> subspan(size_t pos, size_t len) const { | 261 | | // absl::Span throws an exception here. Note std::span and Chromium | 262 | | // base::span forbid pos + len being out of range, with a special case at | 263 | | // npos/dynamic_extent, whereas absl::Span::subspan clips the span. This | 264 | | // implements the std::span behavior which is more strict. | 265 | 269k | BSSL_CHECK(pos <= size()); | 266 | 269k | BSSL_CHECK(len <= size() - pos); | 267 | 269k | return Span<T>(data() + pos, len); | 268 | 269k | } |
|
269 | | |
270 | | // NOTE: This method may abort() at runtime if pos is out of range. |
271 | 2.48M | constexpr Span<T> subspan(size_t pos) const { |
272 | | // absl::Span throws an exception here. |
273 | 2.48M | BSSL_CHECK(pos <= size()); |
274 | 2.48M | return Span<T>(data() + pos, size() - pos); |
275 | 2.48M | } bssl::Span<unsigned char const, 18446744073709551615ul>::subspan(unsigned long) const Line | Count | Source | 271 | 2.30M | constexpr Span<T> subspan(size_t pos) const { | 272 | | // absl::Span throws an exception here. | 273 | 2.30M | BSSL_CHECK(pos <= size()); | 274 | 2.30M | return Span<T>(data() + pos, size() - pos); | 275 | 2.30M | } |
Unexecuted instantiation: bssl::Span<char const*, 18446744073709551615ul>::subspan(unsigned long) const bssl::Span<unsigned char, 18446744073709551615ul>::subspan(unsigned long) const Line | Count | Source | 271 | 164k | constexpr Span<T> subspan(size_t pos) const { | 272 | | // absl::Span throws an exception here. | 273 | 164k | BSSL_CHECK(pos <= size()); | 274 | 164k | return Span<T>(data() + pos, size() - pos); | 275 | 164k | } |
Unexecuted instantiation: bssl::Span<crypto_ivec_st const, 18446744073709551615ul>::subspan(unsigned long) const bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::subspan(unsigned long) const Line | Count | Source | 271 | 5.79k | constexpr Span<T> subspan(size_t pos) const { | 272 | | // absl::Span throws an exception here. | 273 | 5.79k | BSSL_CHECK(pos <= size()); | 274 | 5.79k | return Span<T>(data() + pos, size() - pos); | 275 | 5.79k | } |
bssl::Span<unsigned char, 32ul>::subspan(unsigned long) const Line | Count | Source | 271 | 1.93k | constexpr Span<T> subspan(size_t pos) const { | 272 | | // absl::Span throws an exception here. | 273 | 1.93k | BSSL_CHECK(pos <= size()); | 274 | 1.93k | return Span<T>(data() + pos, size() - pos); | 275 | 1.93k | } |
|
276 | | |
277 | | // NOTE: This method may abort() at runtime if len is out of range. |
278 | | template <size_t pos, size_t len = dynamic_extent> |
279 | 27.2k | constexpr Span<T, SubspanTypeOutLen(N, pos, len)> subspan() const { |
280 | | // absl::Span throws an exception here. Note std::span and Chromium |
281 | | // base::span forbid pos + len being out of range, with a special case at |
282 | | // npos/dynamic_extent, whereas absl::Span::subspan clips the span. This |
283 | | // implements the std::span behavior which is more strict. |
284 | 27.2k | BSSL_CHECK(pos <= size()); |
285 | 27.2k | BSSL_CHECK(len == dynamic_extent || len <= size() - pos); |
286 | 27.2k | return Span<T, SubspanTypeOutLen(N, pos, len)>( |
287 | 27.2k | data() + pos, SubspanOutLen(size(), pos, len)); |
288 | 27.2k | } Unexecuted instantiation: bssl::Span<unsigned char const, bssl::Span<unsigned char const, 18446744073709551615ul>::SubspanTypeOutLen(18446744073709551615ul, 16ul, 16ul)> bssl::Span<unsigned char const, 18446744073709551615ul>::subspan<16ul, 16ul>() const bssl::Span<unsigned char const, bssl::Span<unsigned char const, 18446744073709551615ul>::SubspanTypeOutLen(18446744073709551615ul, 12ul, 18446744073709551615ul)> bssl::Span<unsigned char const, 18446744073709551615ul>::subspan<12ul, 18446744073709551615ul>() const Line | Count | Source | 279 | 27.2k | constexpr Span<T, SubspanTypeOutLen(N, pos, len)> subspan() const { | 280 | | // absl::Span throws an exception here. Note std::span and Chromium | 281 | | // base::span forbid pos + len being out of range, with a special case at | 282 | | // npos/dynamic_extent, whereas absl::Span::subspan clips the span. This | 283 | | // implements the std::span behavior which is more strict. | 284 | 27.2k | BSSL_CHECK(pos <= size()); | 285 | 27.2k | BSSL_CHECK(len == dynamic_extent || len <= size() - pos); | 286 | 27.2k | return Span<T, SubspanTypeOutLen(N, pos, len)>( | 287 | 27.2k | data() + pos, SubspanOutLen(size(), pos, len)); | 288 | 27.2k | } |
Unexecuted instantiation: bssl::Span<unsigned char const, bssl::Span<unsigned char const, 18446744073709551615ul>::SubspanTypeOutLen(18446744073709551615ul, 4ul, 18446744073709551615ul)> bssl::Span<unsigned char const, 18446744073709551615ul>::subspan<4ul, 18446744073709551615ul>() const |
289 | | |
290 | | // NOTE: This method may abort() at runtime if len is out of range. |
291 | 917k | constexpr Span<T> first(size_t len) const { |
292 | 917k | BSSL_CHECK(len <= size()); |
293 | 917k | return Span<T>(data(), len); |
294 | 917k | } bssl::Span<unsigned char const, 18446744073709551615ul>::first(unsigned long) const Line | Count | Source | 291 | 195k | constexpr Span<T> first(size_t len) const { | 292 | 195k | BSSL_CHECK(len <= size()); | 293 | 195k | return Span<T>(data(), len); | 294 | 195k | } |
Unexecuted instantiation: bssl::Span<char const*, 18446744073709551615ul>::first(unsigned long) const bssl::Span<unsigned char, 80ul>::first(unsigned long) const Line | Count | Source | 291 | 56.3k | constexpr Span<T> first(size_t len) const { | 292 | 56.3k | BSSL_CHECK(len <= size()); | 293 | 56.3k | return Span<T>(data(), len); | 294 | 56.3k | } |
bssl::Span<unsigned char, 24ul>::first(unsigned long) const Line | Count | Source | 291 | 56.3k | constexpr Span<T> first(size_t len) const { | 292 | 56.3k | BSSL_CHECK(len <= size()); | 293 | 56.3k | return Span<T>(data(), len); | 294 | 56.3k | } |
bssl::Span<unsigned char, 32ul>::first(unsigned long) const Line | Count | Source | 291 | 43.6k | constexpr Span<T> first(size_t len) const { | 292 | 43.6k | BSSL_CHECK(len <= size()); | 293 | 43.6k | return Span<T>(data(), len); | 294 | 43.6k | } |
bssl::Span<unsigned char, 18446744073709551615ul>::first(unsigned long) const Line | Count | Source | 291 | 554k | constexpr Span<T> first(size_t len) const { | 292 | 554k | BSSL_CHECK(len <= size()); | 293 | 554k | return Span<T>(data(), len); | 294 | 554k | } |
Unexecuted instantiation: bssl::Span<unsigned char, 64ul>::first(unsigned long) const Unexecuted instantiation: bssl::Span<crypto_iovec_st const, 18446744073709551615ul>::first(unsigned long) const bssl::Span<unsigned char, 16ul>::first(unsigned long) const Line | Count | Source | 291 | 399 | constexpr Span<T> first(size_t len) const { | 292 | 399 | BSSL_CHECK(len <= size()); | 293 | 399 | return Span<T>(data(), len); | 294 | 399 | } |
Unexecuted instantiation: bssl::Span<crypto_iovec_st, 18446744073709551615ul>::first(unsigned long) const Unexecuted instantiation: bssl::Span<unsigned char, 8ul>::first(unsigned long) const bssl::Span<unsigned char, 320ul>::first(unsigned long) const Line | Count | Source | 291 | 4.27k | constexpr Span<T> first(size_t len) const { | 292 | 4.27k | BSSL_CHECK(len <= size()); | 293 | 4.27k | return Span<T>(data(), len); | 294 | 4.27k | } |
bssl::Span<unsigned char const, 9ul>::first(unsigned long) const Line | Count | Source | 291 | 5.85k | constexpr Span<T> first(size_t len) const { | 292 | 5.85k | BSSL_CHECK(len <= size()); | 293 | 5.85k | return Span<T>(data(), len); | 294 | 5.85k | } |
|
295 | | |
296 | | // NOTE: This method may abort() at runtime if len is out of range. |
297 | | template <size_t len> |
298 | 27.6k | constexpr Span<T, len> first() const { |
299 | 27.6k | BSSL_CHECK(len <= size()); |
300 | 27.6k | return Span<T, len>(data(), len); |
301 | 27.6k | } Unexecuted instantiation: bssl::Span<unsigned char const, 65ul> bssl::Span<unsigned char const, 18446744073709551615ul>::first<65ul>() const bssl::Span<unsigned char const, 16ul> bssl::Span<unsigned char const, 18446744073709551615ul>::first<16ul>() const Line | Count | Source | 298 | 162 | constexpr Span<T, len> first() const { | 299 | 162 | BSSL_CHECK(len <= size()); | 300 | 162 | return Span<T, len>(data(), len); | 301 | 162 | } |
bssl::Span<unsigned char const, 4ul> bssl::Span<unsigned char const, 18446744073709551615ul>::first<4ul>() const Line | Count | Source | 298 | 27.4k | constexpr Span<T, len> first() const { | 299 | 27.4k | BSSL_CHECK(len <= size()); | 300 | 27.4k | return Span<T, len>(data(), len); | 301 | 27.4k | } |
bssl::Span<unsigned char, 8ul> bssl::Span<unsigned char, 18446744073709551615ul>::first<8ul>() const Line | Count | Source | 298 | 39 | constexpr Span<T, len> first() const { | 299 | 39 | BSSL_CHECK(len <= size()); | 300 | 39 | return Span<T, len>(data(), len); | 301 | 39 | } |
|
302 | | |
303 | | // NOTE: This method may abort() at runtime if len is out of range. |
304 | 18.0k | constexpr Span<T> last(size_t len) const { |
305 | 18.0k | BSSL_CHECK(len <= size()); |
306 | 18.0k | return Span<T>(data() + size() - len, len); |
307 | 18.0k | } bssl::Span<unsigned char, 18446744073709551615ul>::last(unsigned long) const Line | Count | Source | 304 | 8.15k | constexpr Span<T> last(size_t len) const { | 305 | 8.15k | BSSL_CHECK(len <= size()); | 306 | 8.15k | return Span<T>(data() + size() - len, len); | 307 | 8.15k | } |
bssl::Span<unsigned char const, 18446744073709551615ul>::last(unsigned long) const Line | Count | Source | 304 | 528 | constexpr Span<T> last(size_t len) const { | 305 | 528 | BSSL_CHECK(len <= size()); | 306 | 528 | return Span<T>(data() + size() - len, len); | 307 | 528 | } |
bssl::Span<unsigned char const, 4ul>::last(unsigned long) const Line | Count | Source | 304 | 2.03k | constexpr Span<T> last(size_t len) const { | 305 | 2.03k | BSSL_CHECK(len <= size()); | 306 | 2.03k | return Span<T>(data() + size() - len, len); | 307 | 2.03k | } |
bssl::Span<unsigned char const, 6ul>::last(unsigned long) const Line | Count | Source | 304 | 7.34k | constexpr Span<T> last(size_t len) const { | 305 | 7.34k | BSSL_CHECK(len <= size()); | 306 | 7.34k | return Span<T>(data() + size() - len, len); | 307 | 7.34k | } |
|
308 | | |
309 | | // NOTE: This method may abort() at runtime if len is out of range. |
310 | | template <size_t len> |
311 | 8.95k | constexpr Span<T, len> last() const { |
312 | 8.95k | BSSL_CHECK(len <= size()); |
313 | 8.95k | return Span<T, len>(data() + size() - len, len); |
314 | 8.95k | } bssl::Span<unsigned char, 8ul> bssl::Span<unsigned char, 32ul>::last<8ul>() const Line | Count | Source | 311 | 8.72k | constexpr Span<T, len> last() const { | 312 | 8.72k | BSSL_CHECK(len <= size()); | 313 | 8.72k | return Span<T, len>(data() + size() - len, len); | 314 | 8.72k | } |
bssl::Span<unsigned char, 8ul> bssl::Span<unsigned char, 18446744073709551615ul>::last<8ul>() const Line | Count | Source | 311 | 227 | constexpr Span<T, len> last() const { | 312 | 227 | BSSL_CHECK(len <= size()); | 313 | 227 | return Span<T, len>(data() + size() - len, len); | 314 | 227 | } |
|
315 | | }; |
316 | | |
317 | | template <typename T> |
318 | | Span(T *, size_t) -> Span<T>; |
319 | | template <typename T, size_t size> |
320 | | Span(T (&array)[size]) -> Span<T, size>; |
321 | | template <typename T, size_t size> |
322 | | Span(std::array<T, size> &array) -> Span<T, size>; |
323 | | template <typename T, size_t size> |
324 | | Span(const std::array<T, size> &array) -> Span<const T, size>; |
325 | | template < |
326 | | typename C, |
327 | | typename T = std::remove_pointer_t<decltype(std::declval<C>().data())>, |
328 | | typename = internal::EnableIfContainer<C, T>> |
329 | | Span(C &) -> Span<T>; |
330 | | |
331 | | template <typename T> |
332 | | constexpr Span<T> MakeSpan(T *ptr, size_t size) { |
333 | | return Span<T>(ptr, size); |
334 | | } |
335 | | |
336 | | template <typename C> |
337 | | constexpr auto MakeSpan(C &c) -> decltype(MakeSpan(c.data(), c.size())) { |
338 | | return MakeSpan(c.data(), c.size()); |
339 | | } |
340 | | |
341 | | template <typename T, size_t N> |
342 | | constexpr Span<T, N> MakeSpan(T (&array)[N]) { |
343 | | return array; |
344 | | } |
345 | | |
346 | | template <typename T> |
347 | 3.58M | constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) { |
348 | 3.58M | return Span<const T>(ptr, size); |
349 | 3.58M | } bssl::Span<unsigned char const, 18446744073709551615ul> bssl::MakeConstSpan<unsigned char const>(unsigned char const*, unsigned long) Line | Count | Source | 347 | 3.04M | constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) { | 348 | 3.04M | return Span<const T>(ptr, size); | 349 | 3.04M | } |
bssl::Span<bool const, 18446744073709551615ul> bssl::MakeConstSpan<bool const>(bool const*, unsigned long) Line | Count | Source | 347 | 22.0k | constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) { | 348 | 22.0k | return Span<const T>(ptr, size); | 349 | 22.0k | } |
bssl::Span<unsigned short const, 18446744073709551615ul> bssl::MakeConstSpan<unsigned short const>(unsigned short const*, unsigned long) Line | Count | Source | 347 | 392k | constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) { | 348 | 392k | return Span<const T>(ptr, size); | 349 | 392k | } |
bssl::Span<unsigned int const, 18446744073709551615ul> bssl::MakeConstSpan<unsigned int const>(unsigned int const*, unsigned long) Line | Count | Source | 347 | 121k | constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) { | 348 | 121k | return Span<const T>(ptr, size); | 349 | 121k | } |
Unexecuted instantiation: bssl::Span<unsigned char const, 18446744073709551615ul> bssl::MakeConstSpan<unsigned char>(unsigned char*, unsigned long) bssl::Span<crypto_iovec_st const, 18446744073709551615ul> bssl::MakeConstSpan<crypto_iovec_st const>(crypto_iovec_st const*, unsigned long) Line | Count | Source | 347 | 4.27k | constexpr Span<const T> MakeConstSpan(T *ptr, size_t size) { | 348 | 4.27k | return Span<const T>(ptr, size); | 349 | 4.27k | } |
|
350 | | |
351 | | template <typename C> |
352 | | constexpr auto MakeConstSpan(const C &c) |
353 | 3.36M | -> decltype(MakeConstSpan(c.data(), c.size())) { |
354 | 3.36M | return MakeConstSpan(c.data(), c.size()); |
355 | 3.36M | } decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::Array<unsigned char> >(bssl::Array<unsigned char> const&)Line | Count | Source | 353 | 1.30M | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 1.30M | return MakeConstSpan(c.data(), c.size()); | 355 | 1.30M | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::InplaceVector<unsigned char, 2ul> >(bssl::InplaceVector<unsigned char, 2ul> const&)Line | Count | Source | 353 | 243k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 243k | return MakeConstSpan(c.data(), c.size()); | 355 | 243k | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::InplaceVector<unsigned char, 48ul> >(bssl::InplaceVector<unsigned char, 48ul> const&)Line | Count | Source | 353 | 490k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 490k | return MakeConstSpan(c.data(), c.size()); | 355 | 490k | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::InplaceVector<unsigned char, 12ul> >(bssl::InplaceVector<unsigned char, 12ul> const&)Line | Count | Source | 353 | 185k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 185k | return MakeConstSpan(c.data(), c.size()); | 355 | 185k | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::InplaceVector<unsigned char, 32ul> >(bssl::InplaceVector<unsigned char, 32ul> const&)Line | Count | Source | 353 | 602k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 602k | return MakeConstSpan(c.data(), c.size()); | 355 | 602k | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::Array<bool> >(bssl::Array<bool> const&)Line | Count | Source | 353 | 22.0k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 22.0k | return MakeConstSpan(c.data(), c.size()); | 355 | 22.0k | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::Array<unsigned short> >(bssl::Array<unsigned short> const&)Line | Count | Source | 353 | 392k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 392k | return MakeConstSpan(c.data(), c.size()); | 355 | 392k | } |
decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::Array<unsigned int> >(bssl::Array<unsigned int> const&)Line | Count | Source | 353 | 121k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 121k | return MakeConstSpan(c.data(), c.size()); | 355 | 121k | } |
Unexecuted instantiation: decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::InplaceVector<unsigned short, 7ul> >(bssl::InplaceVector<unsigned short, 7ul> const&)decltype (MakeConstSpan(({parm#1}.data)(), ({parm#1}.size)())) bssl::MakeConstSpan<bssl::InplaceVector<crypto_iovec_st, 16ul> >(bssl::InplaceVector<crypto_iovec_st, 16ul> const&)Line | Count | Source | 353 | 4.27k | -> decltype(MakeConstSpan(c.data(), c.size())) { | 354 | 4.27k | return MakeConstSpan(c.data(), c.size()); | 355 | 4.27k | } |
|
356 | | |
357 | | template <typename T, size_t size> |
358 | | constexpr Span<const T, size> MakeConstSpan(T (&array)[size]) { |
359 | | return array; |
360 | | } |
361 | | |
362 | 221k | inline Span<const uint8_t> StringAsBytes(std::string_view s) { |
363 | 221k | return MakeConstSpan(reinterpret_cast<const uint8_t *>(s.data()), s.size()); |
364 | 221k | } |
365 | | |
366 | 209k | inline std::string_view BytesAsStringView(bssl::Span<const uint8_t> b) { |
367 | 209k | return std::string_view(reinterpret_cast<const char *>(b.data()), b.size()); |
368 | 209k | } |
369 | | |
370 | | BSSL_NAMESPACE_END |
371 | | |
372 | | } // extern C++ |
373 | | |
374 | | #endif // !defined(BORINGSSL_NO_CXX) |
375 | | |
376 | | #endif // OPENSSL_HEADER_SSL_SPAN_H |