Sen API
Sen Libraries
Loading...
Searching...
No Matches
span.h File Reference
#include "sen/core/base/assert.h"
#include "sen/core/base/compiler_macros.h"
#include <array>
#include <iterator>
#include <vector>

Go to the source code of this file.

Classes

class  sen::Span< T >
 Contiguous view of elements of type T. Inspired by http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0122r7.pdf. More...

Namespaces

namespace  sen

Functions

template<typename T>
constexpr bool sen::operator== (const Span< T > &lhs, const Span< T > &rhs) noexcept
template<typename T>
constexpr bool sen::operator!= (const Span< T > &lhs, const Span< T > &rhs) noexcept
template<typename T>
constexpr Span< T > sen::makeSpan (T *ptr, std::size_t size) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span.
template<typename T, std::size_t n>
constexpr Span< T > sen::makeSpan (T(&arr)[n]) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span.
template<typename T>
constexpr Span< T > sen::makeSpan (T &val) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span.
template<typename Iterator, typename T = typename std::iterator_traits<Iterator>::value_type>
constexpr Span< T > sen::makeSpan (Iterator first, Iterator last) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span.
template<typename T>
constexpr Span< T > sen::makeSpan (std::vector< T > &vector) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span.
template<typename T, std::size_t s>
constexpr Span< T > sen::makeSpan (std::array< T, s > &array) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span.
template<typename T>
constexpr Span< const T > sen::makeConstSpan (const T *ptr, std::size_t size) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
template<typename T, std::size_t n>
constexpr Span< const T > sen::makeConstSpan (const T(&arr)[n]) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
template<typename Iterator, typename T = typename std::iterator_traits<Iterator>::value_type>
constexpr Span< const T > sen::makeConstSpan (Iterator first, Iterator last) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
template<typename T>
constexpr Span< const T > sen::makeConstSpan (const std::vector< T > &vector) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.
template<typename T, std::size_t s>
constexpr Span< const T > sen::makeConstSpan (const std::array< T, s > &array) noexcept
 Takes in a type that can be passed to a contiguous range and returns a Span. The element types will be const qualified.