kblib 0.2.3
General utilities library for modern C++
kblib::trivial_array< T, N > Struct Template Reference

std::array isn't constexpr enough in C++14, so a dedicated array class is needed for constexpr functions. More...

#include <kblib/stats.h>

Public Member Functions

constexpr auto operator[] (std::size_t n) -> T &
 
constexpr auto operator[] (std::size_t n) const -> const T &
 
constexpr auto size () const -> std::size_t
 
constexpr auto begin () &noexcept -> T *
 
constexpr auto begin () const &noexcept -> const T *
 
constexpr auto end () &noexcept -> T *
 
constexpr auto end () const &noexcept -> const T *
 

Public Attributes

arr [N]
 

Friends

constexpr friend auto operator== (const trivial_array &a, const trivial_array &b) noexcept -> bool
 
constexpr friend auto operator!= (const trivial_array &a, const trivial_array &b) noexcept -> bool
 

Detailed Description

template<typename T, std::size_t N>
struct kblib::trivial_array< T, N >

std::array isn't constexpr enough in C++14, so a dedicated array class is needed for constexpr functions.

Definition at line 84 of file stats.h.

Member Function Documentation

◆ begin() [1/2]

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::begin ( ) & -> T*
inlineconstexprnoexcept

Definition at line 93 of file stats.h.

◆ begin() [2/2]

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::begin ( ) const & -> const T*
inlineconstexprnoexcept

Definition at line 94 of file stats.h.

◆ end() [1/2]

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::end ( ) & -> T*
inlineconstexprnoexcept

Definition at line 97 of file stats.h.

◆ end() [2/2]

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::end ( ) const & -> const T*
inlineconstexprnoexcept

Definition at line 98 of file stats.h.

◆ operator[]() [1/2]

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::operator[] ( std::size_t  n) -> T&
inlineconstexpr

Definition at line 86 of file stats.h.

◆ operator[]() [2/2]

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::operator[] ( std::size_t  n) const -> const T&
inlineconstexpr

Definition at line 89 of file stats.h.

◆ size()

template<typename T , std::size_t N>
constexpr auto kblib::trivial_array< T, N >::size ( ) const -> std::size_t
inlineconstexpr

Definition at line 92 of file stats.h.

Friends And Related Function Documentation

◆ operator!=

template<typename T , std::size_t N>
constexpr friend auto operator!= ( const trivial_array< T, N > &  a,
const trivial_array< T, N > &  b 
) -> bool
friend

Definition at line 106 of file stats.h.

◆ operator==

template<typename T , std::size_t N>
constexpr friend auto operator== ( const trivial_array< T, N > &  a,
const trivial_array< T, N > &  b 
) -> bool
friend

Definition at line 102 of file stats.h.

Member Data Documentation

◆ arr

template<typename T , std::size_t N>
T kblib::trivial_array< T, N >::arr[N]

Definition at line 85 of file stats.h.


The documentation for this struct was generated from the following file: