cxxomfort  rel.20210622
Simple backports for C++ - http://ryan.gulix.cl/fossil.cgi/cxxomfort/
Classes | Namespaces | Functions
n3334-array_ref.hpp File Reference

Classes

class  array_ref< T, IdxType >
 An object representing a reference or slice of a contiguous area of memory of type T . More...
 
struct  is_array_ref< T >
 Type trait that identifies types of array_ref . More...
 

Namespaces

 cxxomfort
 Namespace of the cxxomfort library.
 

Functions

template<typename T >
CXXO_CONSTEXPR bool operator== (array_ref< T > const &a1, array_ref< T > const &a2) CXXO_NOEXCEPTNOTHROW
 Compare array_refs for equality.
 
template<typename T >
CXXO_CONSTEXPR bool operator!= (array_ref< T > const &a1, array_ref< T > const &a2) CXXO_NOEXCEPTNOTHROW
 Compare array_refs for equality.
 
template<typename Ty >
array_ref< Ty > arrayref (Ty *p, size_t l)
 Create a (potentially writeable) arrayref view of a buffer with size. More...
 
template<typename Ty , size_t N>
array_ref< Ty > arrayref (Ty(&p)[N])
 
template<typename Ty >
array_ref< Ty const > carrayref (Ty *p, size_t l)
 Create a const arrayref view of a buffer with size. More...
 
template<typename Ty , size_t N>
array_ref< Ty const > carrayref (Ty(&p)[N])
 
template<typename Ty >
array_ref< Ty const > carrayref (array_ref< Ty > const &a)
 
template<typename T , typename U >
array_ref< T const > carrayref (array_ref< U const > const &a)
 

Function Documentation

◆ arrayref() [1/2]

array_ref<Ty> cxxomfort::impl::array_ref::arrayref ( Ty *  p,
size_t  l 
)

Create a (potentially writeable) arrayref view of a buffer with size.

Returns
A view of data of type Ty .

Referenced by cxxomfort::impl::array_ref::arrayref().

◆ arrayref() [2/2]

array_ref<Ty> cxxomfort::impl::array_ref::arrayref ( Ty(&)  p[N])

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ carrayref() [1/4]

array_ref<Ty const> cxxomfort::impl::array_ref::carrayref ( Ty *  p,
size_t  l 
)

Create a const arrayref view of a buffer with size.

Returns
A view of const data of type Ty .

Referenced by cxxomfort::impl::array_ref::carrayref().

◆ carrayref() [2/4]

array_ref<Ty const> cxxomfort::impl::array_ref::carrayref ( Ty(&)  p[N])

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ carrayref() [3/4]

array_ref<Ty const> cxxomfort::impl::array_ref::carrayref ( array_ref< Ty > const &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ carrayref() [4/4]

array_ref<T const> cxxomfort::impl::array_ref::carrayref ( array_ref< U const > const &  a)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.