cube_ptrs_outcheck< glue_type, T1 > Struct Template Reference
[Glue_cube_metaprog]

template metaprogram cube_ptrs_outcheck builds on 'cube_ptrs' by also checking whether any of the input cubes are aliases of the output cube More...

#include <glue_cube_metaprog.hpp>

List of all members.

Public Types

typedef T1::elem_type elem_type

Static Public Member Functions

static void get_ptrs (const Cube< elem_type > **ptrs, bool *del, const T1 &X, const Cube< elem_type > *out_ptr)

Static Public Attributes

static const u32 num = 0

Detailed Description

template<typename glue_type, typename T1>
struct cube_ptrs_outcheck< glue_type, T1 >

template metaprogram cube_ptrs_outcheck builds on 'cube_ptrs' by also checking whether any of the input cubes are aliases of the output cube

Definition at line 132 of file glue_cube_metaprog.hpp.


Member Typedef Documentation

template<typename glue_type , typename T1 >
typedef T1::elem_type cube_ptrs_outcheck< glue_type, T1 >::elem_type

Definition at line 134 of file glue_cube_metaprog.hpp.


Member Function Documentation

template<typename glue_type , typename T1 >
static void cube_ptrs_outcheck< glue_type, T1 >::get_ptrs ( const Cube< elem_type > **  ptrs,
bool *  del,
const T1 &  X,
const Cube< elem_type > *  out_ptr 
) [inline, static]

Definition at line 142 of file glue_cube_metaprog.hpp.

Referenced by cube_ptrs_outcheck< glue_type, GlueCube< T1, T2, glue_type > >::get_ptrs().

00148     {
00149 
00150     const bool same_ptr = 
00151       (
00152       is_Cube<T1>::value ?
00153         (
00154         (out_ptr == reinterpret_cast<const Cube<elem_type>*>(&X)) ?
00155           true
00156         :
00157           false
00158         )
00159       :
00160         false
00161       );
00162 
00163     
00164     ptrs[0] = 
00165       (
00166       same_ptr ?
00167         new Cube<elem_type>(X)
00168       :
00169         (
00170         is_Cube<T1>::value ?
00171           reinterpret_cast<const Cube<elem_type>*>(&X)
00172         :
00173           new Cube<elem_type>(X)
00174         )
00175       );
00176 
00177     
00178     del[0] = 
00179       (
00180       same_ptr ?
00181         true
00182       :
00183         (
00184         is_Cube<T1>::value ?
00185           false
00186         :
00187           true
00188         )
00189       );
00190 
00191     
00192     }


Member Data Documentation

template<typename glue_type , typename T1 >
const u32 cube_ptrs_outcheck< glue_type, T1 >::num = 0 [static]