tesseract++ 0.0.1
N-dimensional tensor library for embedded systems
Loading...
Searching...
No Matches
Classes | Functions
helper_traits.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Pack< Dims >
 Wrapper struct for carrying a non-type parameter pack. More...
 
struct  index_seq< Is >
 Compile-time index sequence (lightweight std::index_sequence alternative). More...
 
struct  make_index_seq< N, Is >
 Recursive generator for index_seq<0, 1, …, N−1>. More...
 

Functions

template<my_size_t First, my_size_t... Rest>
consteval bool all_equal ()
 Check if all values in a parameter pack are equal.
 
template<my_size_t N>
consteval bool dims_match (const my_size_t lhs[N], const my_size_t rhs[N])
 Element-wise equality check of two compile-time arrays.
 
template<my_size_t... Vals>
consteval my_size_t max_value ()
 Compile-time maximum of a non-type parameter pack.
 
template<my_size_t... Vals>
consteval my_size_t min_value ()
 Compile-time minimum of a non-type parameter pack.
 
template<my_size_t... A, my_size_t... B>
consteval bool packs_are_identical (Pack< A... >, Pack< B... >)
 Element-wise equality comparison of two packs.
 
template<my_size_t... A, my_size_t... B>
consteval bool same_min_max (Pack< A... >, Pack< B... >)
 Check if two packs have the same min and max values, regardless of order.
 
template<my_size_t... Vals>
consteval bool all_unique ()
 Check if all values in a pack are unique.
 
template<my_size_t... Vals>
consteval bool is_sequential ()
 Check if a pack forms the identity permutation {0, 1, …, N−1}.
 

Function Documentation

◆ all_equal()

template<my_size_t First, my_size_t... Rest>
consteval bool all_equal ( )

Check if all values in a parameter pack are equal.

Template Parameters
FirstFirst value in the pack.
RestRemaining values.
Returns
True if every value equals First.

◆ all_unique()

template<my_size_t... Vals>
consteval bool all_unique ( )

Check if all values in a pack are unique.

Template Parameters
ValsOne or more values (static_assert enforced).
Returns
True if no two values are equal (O(N²) comparison).

◆ dims_match()

template<my_size_t N>
consteval bool dims_match ( const my_size_t  lhs[N],
const my_size_t  rhs[N] 
)

Element-wise equality check of two compile-time arrays.

Template Parameters
NArray length.
Parameters
lhsFirst array.
rhsSecond array.
Returns
True if all corresponding elements match.

◆ is_sequential()

template<my_size_t... Vals>
consteval bool is_sequential ( )

Check if a pack forms the identity permutation {0, 1, …, N−1}.

Template Parameters
ValsOne or more values (static_assert enforced).
Returns
True if Vals[i] == i for all i.

◆ max_value()

template<my_size_t... Vals>
consteval my_size_t max_value ( )

Compile-time maximum of a non-type parameter pack.

Template Parameters
ValsOne or more values (static_assert enforced).
Returns
The largest value in the pack.

◆ min_value()

template<my_size_t... Vals>
consteval my_size_t min_value ( )

Compile-time minimum of a non-type parameter pack.

Template Parameters
ValsOne or more values (static_assert enforced).
Returns
The smallest value in the pack.

◆ packs_are_identical()

template<my_size_t... A, my_size_t... B>
consteval bool packs_are_identical ( Pack< A... >  ,
Pack< B... >   
)

Element-wise equality comparison of two packs.

Template Parameters
AValues in the first pack.
BValues in the second pack.
Returns
True if both packs have the same length and identical elements.

◆ same_min_max()

template<my_size_t... A, my_size_t... B>
consteval bool same_min_max ( Pack< A... >  ,
Pack< B... >   
)

Check if two packs have the same min and max values, regardless of order.

Template Parameters
AValues in the first pack.
BValues in the second pack.
Returns
True if min and max match, false otherwise.
Here is the call graph for this function: