libcopp  2.2.0
Namespaces | Data Structures | Typedefs | Functions | Variables
gsl Namespace Reference

Namespaces

 detail
 
 details
 

Data Structures

class  not_null
 
class  strict_not_null
 
class  span
 
class  span< T, dynamic_extent >
 
struct  _make_span_value_type
 

Typedefs

template<class T , class = typename std::enable_if<std::is_pointer<T>::value>::type>
using owner = T
 

Functions

template<class T >
auto make_not_null (T &&t) noexcept
 
template<class T , class U >
auto operator== (const not_null< T > &lhs, const not_null< U > &rhs) noexcept(noexcept(lhs.get()==rhs.get())) -> decltype(lhs.get()==rhs.get())
 
template<class T , class U >
auto operator!= (const not_null< T > &lhs, const not_null< U > &rhs) noexcept(noexcept(lhs.get() !=rhs.get())) -> decltype(lhs.get() !=rhs.get())
 
template<class T , class U >
auto operator< (const not_null< T > &lhs, const not_null< U > &rhs) noexcept(noexcept(lhs.get()< rhs.get())) -> decltype(lhs.get()< rhs.get())
 
template<class T , class U >
auto operator<= (const not_null< T > &lhs, const not_null< U > &rhs) noexcept(noexcept(lhs.get()<=rhs.get())) -> decltype(lhs.get()<=rhs.get())
 
template<class T , class U >
auto operator> (const not_null< T > &lhs, const not_null< U > &rhs) noexcept(noexcept(lhs.get() > rhs.get())) -> decltype(lhs.get() > rhs.get())
 
template<class T , class U >
auto operator>= (const not_null< T > &lhs, const not_null< U > &rhs) noexcept(noexcept(lhs.get() >=rhs.get())) -> decltype(lhs.get() >=rhs.get())
 
template<class T , class U >
std::ptrdiff_t operator- (const not_null< T > &, const not_null< U > &)=delete
 
template<class T >
not_null< T > operator- (const not_null< T > &, std::ptrdiff_t)=delete
 
template<class T >
not_null< T > operator+ (const not_null< T > &, std::ptrdiff_t)=delete
 
template<class T >
not_null< T > operator+ (std::ptrdiff_t, const not_null< T > &)=delete
 
template<class T , class U >
std::ptrdiff_t operator- (const strict_not_null< T > &, const strict_not_null< U > &)=delete
 
template<class T >
strict_not_null< T > operator- (const strict_not_null< T > &, std::ptrdiff_t)=delete
 
template<class T >
strict_not_null< T > operator+ (const strict_not_null< T > &, std::ptrdiff_t)=delete
 
template<class T >
strict_not_null< T > operator+ (std::ptrdiff_t, const strict_not_null< T > &)=delete
 
template<class T >
auto make_strict_not_null (T &&t) noexcept
 
template<class TCONTAINER >
constexpr auto size (TCONTAINER &&container) -> decltype(container.size())
 
template<class T , size_t SIZE>
constexpr size_t size (const T(&)[SIZE]) noexcept
 
template<class TCONTAINER >
constexpr auto data (TCONTAINER &&container) -> decltype(container.data())
 
template<class T , size_t SIZE>
constexpr T * data (T(&array_value)[SIZE]) noexcept
 
template<class TELEMENT >
constexpr const TELEMENT * data (std::initializer_list< TELEMENT > l) noexcept
 
template<class TELEMENT >
constexpr span< TELEMENT > make_span (TELEMENT *ptr, typename span< TELEMENT >::size_type count)
 
template<class TELEMENT >
constexpr span< TELEMENT > make_span (TELEMENT *first, TELEMENT *last)
 
template<class TELEMENT , std::size_t N>
constexpr span< TELEMENT, N > make_span (TELEMENT(&arr)[N]) noexcept
 
template<class TCONTAINER , typename std::enable_if< !std::is_array< typename std::remove_reference< TCONTAINER >::type >::value &&std::is_pointer< decltype(data(std::declval< TCONTAINER >()))>::value &&std::is_convertible< decltype(size(std::declval< TCONTAINER >())), size_t >::value , ::type * = nullptr>
constexpr span< typename _make_span_value_type< TCONTAINER >::type > make_span (TCONTAINER &&cont)
 

Variables

constexpr size_t dynamic_extent = static_cast<size_t>(-1)
 

Typedef Documentation

◆ owner

template<class T , class = typename std::enable_if<std::is_pointer<T>::value>::type>
using gsl::owner = typedef T

Definition at line 49 of file not_null.h.

Function Documentation

◆ data() [1/3]

template<class TELEMENT >
constexpr const TELEMENT* gsl::data ( std::initializer_list< TELEMENT >  l)
inlineconstexprnoexcept

Definition at line 64 of file span.h.

◆ data() [2/3]

template<class T , size_t SIZE>
constexpr T* gsl::data ( T(&)  array_value[SIZE])
inlineconstexprnoexcept

Definition at line 59 of file span.h.

◆ data() [3/3]

template<class TCONTAINER >
constexpr auto gsl::data ( TCONTAINER &&  container) -> decltype(container.data())
inlineconstexpr

Definition at line 54 of file span.h.

◆ make_not_null()

template<class T >
auto gsl::make_not_null ( T &&  t)
noexcept

Definition at line 111 of file not_null.h.

◆ make_span() [1/4]

template<class TCONTAINER , typename std::enable_if< !std::is_array< typename std::remove_reference< TCONTAINER >::type >::value &&std::is_pointer< decltype(data(std::declval< TCONTAINER >()))>::value &&std::is_convertible< decltype(size(std::declval< TCONTAINER >())), size_t >::value , ::type * = nullptr>
constexpr span<typename _make_span_value_type<TCONTAINER>::type> gsl::make_span ( TCONTAINER &&  cont)
constexpr

Definition at line 280 of file span.h.

◆ make_span() [2/4]

template<class TELEMENT >
constexpr span<TELEMENT> gsl::make_span ( TELEMENT *  first,
TELEMENT *  last 
)
constexpr

Definition at line 260 of file span.h.

◆ make_span() [3/4]

template<class TELEMENT >
constexpr span<TELEMENT> gsl::make_span ( TELEMENT *  ptr,
typename span< TELEMENT >::size_type  count 
)
constexpr

Definition at line 255 of file span.h.

◆ make_span() [4/4]

template<class TELEMENT , std::size_t N>
constexpr span<TELEMENT, N> gsl::make_span ( TELEMENT(&)  arr[N])
constexprnoexcept

Definition at line 265 of file span.h.

◆ make_strict_not_null()

template<class T >
auto gsl::make_strict_not_null ( T &&  t)
noexcept

Definition at line 230 of file not_null.h.

◆ operator!=()

template<class T , class U >
auto gsl::operator!= ( const not_null< T > &  lhs,
const not_null< U > &  rhs 
) -> decltype(lhs.get() != rhs.get())
noexcept

Definition at line 122 of file not_null.h.

◆ operator+() [1/4]

template<class T >
not_null<T> gsl::operator+ ( const not_null< T > &  ,
std::ptrdiff_t   
)
delete

◆ operator+() [2/4]

template<class T >
strict_not_null<T> gsl::operator+ ( const strict_not_null< T > &  ,
std::ptrdiff_t   
)
delete

◆ operator+() [3/4]

template<class T >
not_null<T> gsl::operator+ ( std::ptrdiff_t  ,
const not_null< T > &   
)
delete

◆ operator+() [4/4]

template<class T >
strict_not_null<T> gsl::operator+ ( std::ptrdiff_t  ,
const strict_not_null< T > &   
)
delete

◆ operator-() [1/4]

template<class T , class U >
std::ptrdiff_t gsl::operator- ( const not_null< T > &  ,
const not_null< U > &   
)
delete

◆ operator-() [2/4]

template<class T >
not_null<T> gsl::operator- ( const not_null< T > &  ,
std::ptrdiff_t   
)
delete

◆ operator-() [3/4]

template<class T , class U >
std::ptrdiff_t gsl::operator- ( const strict_not_null< T > &  ,
const strict_not_null< U > &   
)
delete

◆ operator-() [4/4]

template<class T >
strict_not_null<T> gsl::operator- ( const strict_not_null< T > &  ,
std::ptrdiff_t   
)
delete

◆ operator<()

template<class T , class U >
auto gsl::operator< ( const not_null< T > &  lhs,
const not_null< U > &  rhs 
) -> decltype(lhs.get() < rhs.get())
noexcept

Definition at line 128 of file not_null.h.

◆ operator<=()

template<class T , class U >
auto gsl::operator<= ( const not_null< T > &  lhs,
const not_null< U > &  rhs 
) -> decltype(lhs.get() <= rhs.get())
noexcept

Definition at line 134 of file not_null.h.

◆ operator==()

template<class T , class U >
auto gsl::operator== ( const not_null< T > &  lhs,
const not_null< U > &  rhs 
) -> decltype(lhs.get() == rhs.get())
noexcept

Definition at line 116 of file not_null.h.

◆ operator>()

template<class T , class U >
auto gsl::operator> ( const not_null< T > &  lhs,
const not_null< U > &  rhs 
) -> decltype(lhs.get() > rhs.get())
noexcept

Definition at line 140 of file not_null.h.

◆ operator>=()

template<class T , class U >
auto gsl::operator>= ( const not_null< T > &  lhs,
const not_null< U > &  rhs 
) -> decltype(lhs.get() >= rhs.get())
noexcept

Definition at line 146 of file not_null.h.

◆ size() [1/2]

template<class T , size_t SIZE>
constexpr size_t gsl::size ( const   T(&)[SIZE])
inlineconstexprnoexcept

Definition at line 49 of file span.h.

◆ size() [2/2]

template<class TCONTAINER >
constexpr auto gsl::size ( TCONTAINER &&  container) -> decltype(container.size())
inlineconstexpr

Variable Documentation

◆ dynamic_extent

constexpr size_t gsl::dynamic_extent = static_cast<size_t>(-1)
constexpr

Definition at line 41 of file span.h.