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< T, N, F > Struct Template Reference

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

Detailed Description

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

Main class to generate compile-time array.

A compile time array is for example

const 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<size_t,count, MetaFunc>::result ct_test;
// ct_test::data is equivalent to const size_t [5] = {5,6,7,8,9}
for (size_t i = 0 ; i < count; ++i)
{
const size_t ct_val = ct_test::data[i];
BOOST_REQUIRE_EQUAL(ct_val,count+i);
}
Parameters
Tis the type ot the output array
Nsize of the sequence
FMeta function it take two template arguments

Definition at line 113 of file ct_array.hpp.

#include <ct_array.hpp>

Public Types

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

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