Classes | Typedefs | Functions | Variables
gsl Namespace Reference

Implementations from the Guideline Support Library. More...

Classes

class  not_null
 Require a pointer to not be a nullptr More...
 
class  span
 Create a span/view on a range, which is cheap to copy (one pointer). More...
 

Typedefs

template<class T , Requires< std::is_pointer< T >::value > = nullptr>
using owner = typename detail::owner_impl< T >::type
 Mark a raw pointer as owning its data. More...
 

Functions

template<class T , class U >
constexpr T narrow_cast (U &&u) noexcept
 Cast u to a type T where the cast may result in narrowing.
 
template<class T , class U >
narrow (U u)
 A checked version of narrow_cast() that ERRORs if the cast changed the value.
 
template<class T >
std::ostreamoperator<< (std::ostream &os, const not_null< T > &val)
 
template<class T , class U >
auto operator== (const not_null< T > &lhs, const not_null< U > &rhs) -> decltype(lhs.get()==rhs.get())
 
template<class T , class U >
auto operator!= (const not_null< T > &lhs, const not_null< U > &rhs) -> decltype(lhs.get() !=rhs.get())
 
template<class T , class U >
auto operator< (const not_null< T > &lhs, const not_null< U > &rhs) -> decltype(lhs.get()< rhs.get())
 
template<class T , class U >
auto operator<= (const not_null< T > &lhs, const not_null< U > &rhs) -> decltype(lhs.get()<=rhs.get())
 
template<class T , class U >
auto operator> (const not_null< T > &lhs, const not_null< U > &rhs) -> decltype(lhs.get() > rhs.get())
 
template<class T , class U >
auto operator>= (const not_null< T > &lhs, const not_null< U > &rhs) -> 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 ElementType , std::ptrdiff_t FirstExtent, std::ptrdiff_t SecondExtent>
constexpr bool operator== (span< ElementType, FirstExtent > l, span< ElementType, SecondExtent > r)
 
template<class ElementType , std::ptrdiff_t Extent>
constexpr bool operator!= (span< ElementType, Extent > l, span< ElementType, Extent > r)
 
template<class ElementType , std::ptrdiff_t Extent>
constexpr bool operator< (span< ElementType, Extent > l, span< ElementType, Extent > r)
 
template<class ElementType , std::ptrdiff_t Extent>
constexpr bool operator<= (span< ElementType, Extent > l, span< ElementType, Extent > r)
 
template<class ElementType , std::ptrdiff_t Extent>
constexpr bool operator> (span< ElementType, Extent > l, span< ElementType, Extent > r)
 
template<class ElementType , std::ptrdiff_t Extent>
constexpr bool operator>= (span< ElementType, Extent > l, span< ElementType, Extent > r)
 
template<class ElementType , std::ptrdiff_t Extent>
constexpr ElementType & at (span< ElementType, Extent > s, typename span< ElementType, Extent >::index_type i)
 
template<class T , std::size_t N, typename Size >
constexpr T & at (std::array< T, N > &arr, Size index)
 Retrieve a entry from a container, with checks in Debug mode that the index being retrieved is valid.
 
template<class Cont , typename Size >
constexpr const Cont::value_type & at (const Cont &cont, Size index)
 Retrieve a entry from a container, with checks in Debug mode that the index being retrieved is valid.
 
template<class T , typename Size >
constexpr const T & at (std::initializer_list< T > cont, Size index)
 Retrieve a entry from a container, with checks in Debug mode that the index being retrieved is valid.
 
template<class ElementType >
constexpr span< ElementType > make_span (ElementType *ptr, typename span< ElementType >::index_type count)
 Utility function for creating spans.
 
template<class ElementType >
constexpr span< ElementType > make_span (ElementType *firstElem, ElementType *lastElem)
 Utility function for creating spans.
 
template<class ElementType , std::size_t N>
constexpr span< ElementType, N > make_span (ElementType(&arr)[N]) noexcept
 Utility function for creating spans.
 
template<class Container >
constexpr span< typename Container::value_type > make_span (Container &cont)
 Utility function for creating spans.
 
template<class Container >
constexpr span< const typename Container::value_type > make_span (const Container &cont)
 Utility function for creating spans.
 
template<class Ptr >
constexpr span< typename Ptr::element_type > make_span (Ptr &cont, std::ptrdiff_t count)
 Utility function for creating spans.
 
template<class Ptr >
constexpr span< typename Ptr::element_type > make_span (Ptr &cont)
 Utility function for creating spans.
 

Variables

constexpr const std::ptrdiff_t dynamic_extent = -1
 

Detailed Description

Implementations from the Guideline Support Library.