Bitcoin
|
#include <type_traits>
#include <cstddef>
#include <algorithm>
Go to the source code of this file.
Classes | |
class | Span< C > |
Functions | |
template<typename A , int N> | |
constexpr Span< A > | MakeSpan (A(&a)[N]) |
template<typename V > | |
constexpr Span< typename std::remove_pointer< decltype(std::declval< V >).data())>::type > | MakeSpan (V &v) |
constexpr Span<A> MakeSpan | ( | A(&) | a[N] | ) |
Create a span to a container exposing data() and size().
This correctly deals with constness: the returned Span's element type will be whatever data() returns a pointer to. If either the passed container is const, or its element type is const, the resulting span will have a const element type.
std::span will have a constructor that implements this functionality directly.
constexpr Span<typename std::remove_pointer<decltype(std::declval<V>).data())>::type> MakeSpan | ( | V & | v | ) |