BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
Classes | Functions
span.h File Reference
#include <type_traits>
#include <cstddef>
#include <algorithm>
Include dependency graph for span.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Span< C >
 A Span is an object that can refer to a contiguous sequence of objects. More...
 

Functions

template<typename A , int N>
constexpr Span< A > MakeSpan (A(&a)[N])
 Create a span to a container exposing data() and size(). More...
 
template<typename V >
constexpr Span< typename std::remove_pointer< decltype(std::declval< V >).data())>::type > MakeSpan (V &v)
 

Function Documentation

◆ MakeSpan() [1/2]

template<typename A , int N>
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.

Definition at line 55 of file span.h.

Here is the caller graph for this function:

◆ MakeSpan() [2/2]

template<typename V >
constexpr Span<typename std::remove_pointer<decltype(std::declval<V>).data())>::type> MakeSpan ( V &  v)

Definition at line 58 of file span.h.