CArray< T, N > Struct Template Reference

#include <block.h>

Detailed Description

template<typename T, Int N>
struct maxon::CArray< T, N >

CArray<T, N> wraps a C-style array T[N] in its single member values, and it has conversion operators to Block. It can be used to specify an argument for a function parameter of Block type directly in the function call as in

void Func(const Block<const Int>& values);
Func(CArray<Int, 3>{{1, 4, 42}});

To automatically determine N from the number of elements you can use the macro MAXON_C_ARRAY.

Template Parameters
TType of the array elements.
NSize of the array.

Public Member Functions

 operator Block< T > () const
 
 operator Block< typename std::conditional< std::is_const< T >::value, DummyReturnType, const T >::type > () const
 
 operator StridedBlock< T > () const
 
 operator Block< typename std::conditional< std::is_const< T >::value, DummyReturnType, const T >::type, true > () const
 

Public Attributes

values [N]
 

Member Function Documentation

◆ operator Block< T >()

operator Block< T > ( ) const

◆ operator Block< typename std::conditional< std::is_const< T >::value, DummyReturnType, const T >::type >()

operator Block< typename std::conditional< std::is_const< T >::value, DummyReturnType, const T >::type > ( ) const

◆ operator StridedBlock< T >()

operator StridedBlock< T > ( ) const

◆ operator Block< typename std::conditional< std::is_const< T >::value, DummyReturnType, const T >::type, true >()

operator Block< typename std::conditional< std::is_const< T >::value, DummyReturnType, const T >::type, true > ( ) const

Member Data Documentation

◆ values

T values[N]
maxon::CArray::values
T values[N]
Definition: block.h:945