OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
generate_array_constexpr< T, N, F > Struct Template Reference

Main class to generate constexpr compile-time array. More...

Detailed Description

template<class T, size_t N, template< size_t, size_t > class F>
struct generate_array_constexpr< T, N, F >

Main class to generate constexpr compile-time array.

A constexpr compile time array is for example

constexpr size_t array[5] = {1,2,3,4,5}

Metafunction definition

template<size_t index, size_t N> struct MetaFunc {
enum { value = index + N };
};

Usage

const size_t count = 5;
typedef typename ::generate_array_constexpr<size_t,count, MetaFunc>::result ct_test_ce;
// ct_test_ce::data is equivalent to constexpr size_t [5] = {5,6,7,8,9}
BOOST_REQUIRE_EQUAL(ct_calc,11ul);
Parameters
Tis the type ot the output array
Nsize of the sequence
FMeta function it take two template arguments

Definition at line 65 of file ct_array.hpp.

#include <ct_array.hpp>

Public Types

typedef
generate_array_constexpr_impl
< T, N-1, N, F >::result 
result
 

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