SUNphi  1.0
SUNphi::HasMember_binarize< Type > Struct Template Reference

#include <Binarize.hpp>

Classes

struct  Check
 
struct  Derived
 
struct  Fallback
 

Public Types

using Yes = char[1]
 
using No = char[2]
 

Static Public Member Functions

template<typename U >
static Notest (Check< int Fallback::*,&U::binarize > *)
 
template<typename U >
static Yestest (...)
 

Static Public Attributes

static constexpr bool result = sizeof(test<Derived>(nullptr))==sizeof(Yes)
 

Detailed Description

template<typename Type>
struct SUNphi::HasMember_binarize< Type >

Detect if Type has member (variable or method) binarize

Internal implementation

Definition at line 19 of file Binarize.hpp.

Member Typedef Documentation

template<typename Type >
using SUNphi::HasMember_binarize< Type >::No = char[2]

Internal class of size 2 used if Type has not the method

Definition at line 19 of file Binarize.hpp.

template<typename Type >
using SUNphi::HasMember_binarize< Type >::Yes = char[1]

Internal class of size 1, used if Type has the method

Definition at line 19 of file Binarize.hpp.

Member Function Documentation

template<typename Type >
template<typename U >
static No& SUNphi::HasMember_binarize< Type >::test ( Check< int Fallback::*,&U::binarize > *  )
static

Forward definition of test function, taking a pointer to the

type of binarize as argument, returning No. The instantiation

will fail if Base have two member binarize implemented, which

means that Type has the member

template<typename Type >
template<typename U >
static Yes& SUNphi::HasMember_binarize< Type >::test (   ...)
static

Forward definition of test function, taking a pointer to the

type of binarize as argument, returning Yes. The instantiation

will work when the other fails, which means that Type does

have the member

Member Data Documentation

template<typename Type >
constexpr bool SUNphi::HasMember_binarize< Type >::result = sizeof(test<Derived>(nullptr))==sizeof(Yes)
static

Result of the check, comparing the size of return type of

test with the size of yes

Definition at line 19 of file Binarize.hpp.


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