The Vish Visualization Shell 0.3
Vish
Classes | Typedefs | Functions
META Namespace Reference

META is a collection of low-level template metaprograms which can be used in various situations. More...

Classes

struct  __is_result_convertible
 
class  _META_THIS
 
struct  ASSERT
 
struct  ASSERT< true >
 
struct  BaseClass
 A trait class for determining the base class of something. More...
 
struct  BaseClass< Eagle::bivector3f >
 
struct  BaseClass< Eagle::Column< R, value > >
 
struct  BaseClass< Eagle::DomainVector< VectorType, Domain, scalar_t > >
 
struct  BaseClass< Eagle::Matrix< R, C, Value > >
 
struct  BaseClass< Eagle::PhysicalSpace::bivector >
 
struct  BaseClass< Eagle::PhysicalSpace::point >
 
struct  BaseClass< Eagle::PhysicalSpace::vector >
 
struct  BaseClass< Eagle::point3f >
 
struct  BaseClass< Eagle::rgba_float_t >
 
struct  BaseClass< Eagle::vector3f >
 
struct  BaseClass< Eagle::Vector< T, n > >
 
class  BSort
 
class  BubbleSort
 Todd Veldhuizen Bubblesort Metaprogram http://osl.iu.edu/~tveldhui/papers/Template-Metaprograms/meta-art.html. More...
 
class  BubbleSort< T, 1, Comp >
 
class  BubbleSortLoop
 
class  BubbleSortLoop< T, 0, 0, Comp >
 
struct  ChooseWithOutPermutation
 Expression template to compute the number of possible combinations when choosing K elements from a set of N without differentiating between permutations. More...
 
class  Comparator
 
struct  Fac
 
struct  Fac< 0 >
 
struct  FOREACH
 
class  FOREACH< Exec, LIST< ListType > >
 
struct  FOREACH< Exec, LIST< ListTypes... > >
 Traverse a single linked type list (a LIST metatemplate). More...
 
class  FOREACH< Exec, LIST< NIL > >
 
class  FOREACH< Exec, NIL >
 
struct  FOREACH< Exec, Type >
 
struct  ForEachType
 
class  has_concept
 Check if a class has a specified concept implemented. More...
 
class  has_concept< Class, Result, Concept(Args...)>
 Check if a class has a specified concept implemented. More...
 
class  has_member
 
class  has_member< Result(Args...)>
 Simple check if a member is implemented. More...
 
struct  has_member< T, Result, Name(Args...)>
 Check a checkable member. More...
 
struct  has_member< T, Type, Name >
 Check a checkable member. More...
 
class  has_member< Type >
 Simple check if a member is implemented. More...
 
struct  has_member_template
 
struct  IF
 IF Metatemplate, used to compute a certain type based on the condition. More...
 
struct  IF< false, A, B >
 
class  is_callable
 Template to check whether a type T is callable like a function (functor and functions). More...
 
class  is_functor
 Template to check whether a type T is callable like a function, i.e. More...
 
class  LIST
 Single Linked LIST Metatemplate. More...
 
struct  META_VOID
 
struct  MetaTypeInfo
 
struct  MetaTypeInfo< std::array< T, N > >
 
struct  MetaTypeInfo< std::vector< T > >
 
struct  MetaTypeInfo< T[N]>
 
struct  NIL
 
struct  Pow
 
struct  Pow< N, M, 1 >
 
struct  PreciserType
 
struct  Precision
 
struct  Precision< char >
 
struct  Precision< ddouble >
 
struct  Precision< double >
 
struct  Precision< float >
 
struct  Precision< int >
 
struct  Precision< long >
 
struct  Precision< long double >
 
struct  Precision< qdouble >
 
struct  Precision< short >
 
class  Swap
 
struct  SymmetricChooseWithOutPermutation
 Expression template to compute the combinatoric formula used for the number of elements of a supersymmetric cubical: (2n-1)!/(n-1)!/n! n...mode, way, 'rank'. More...
 
struct  TypeDescriptor
 For native and array types. More...
 

Typedefs

template<typename T , typename ... Args>
using enable_if_callable_t = typename std::enable_if< is_callable< T, Args... >::value, is_callable_t< T, Args... > >::type
 SFINAE for any callable T.
 
typedef LIST< float, LIST< double, LIST< long double > > > FloatTypeList
 A list of all supported native types.
 
typedef LIST< unsigned char, LIST< signed char, LIST< char, LIST< unsigned short, LIST< signed short, LIST< unsigned int, LIST< signed int, LIST< unsigned long, LIST< signed long, LIST< unsigned long long, LIST< signed long long > > > > > > > > > > > IntegerTypeList
 A list of C++ native integer types.
 
template<typename T , typename ... Args>
using is_callable_t = typename is_callable< T, Args... >::type
 Convenience using for typename is_callable<..>::type.
 
typedef LIST< float, LIST< double, LIST< long double, IntegerTypeList > > > NativeTypeList
 A list of all supported native types.
 

Functions

template<class T >
void bubbleSort (T data[], int N)
 Runtime template implementation of bubblesort.
 
template<typename T , typename... Args>
enable_if_callable_t< T, Args... > call (T &&obj, Args &&... args)
 Tempate to call a T if it's callable like a function (functor and functions).
 
template<class T = META_VOID, class... Others>
std::remove_reference< T >::type && declvals ()
 Simple version of: std::forward<T>(std::declval<T>()) And enables to pop the first member of the variadic template argument.
 

Detailed Description

META is a collection of low-level template metaprograms which can be used in various situations.


Class Documentation

◆ META::ASSERT

struct META::ASSERT
template<bool>
struct META::ASSERT< bool >

◆ META::ASSERT< true >

struct META::ASSERT< true >

◆ META::BaseClass

struct META::BaseClass
template<typename T>
struct META::BaseClass< T >

A trait class for determining the base class of something.

Needs to be specialized for anything that has a base class that is to be exported.

struct A
{};
struct B : A
{};
template <>
struct BaseClass<B>
{
typedef A result;
};
Definition RefPtrPerformance.cpp:24

◆ META::BaseClass< Eagle::bivector3f >

struct META::BaseClass< Eagle::bivector3f >

◆ META::BaseClass< Eagle::Column< R, value > >

struct META::BaseClass< Eagle::Column< R, value > >
template<int R, class value>
struct META::BaseClass< Eagle::Column< R, value > >

◆ META::BaseClass< Eagle::DomainVector< VectorType, Domain, scalar_t > >

struct META::BaseClass< Eagle::DomainVector< VectorType, Domain, scalar_t > >
template<class VectorType, class Domain, class scalar_t>
struct META::BaseClass< Eagle::DomainVector< VectorType, Domain, scalar_t > >

◆ META::BaseClass< Eagle::Matrix< R, C, Value > >

struct META::BaseClass< Eagle::Matrix< R, C, Value > >
template<int R, int C, class Value>
struct META::BaseClass< Eagle::Matrix< R, C, Value > >

◆ META::BaseClass< Eagle::PhysicalSpace::bivector >

struct META::BaseClass< Eagle::PhysicalSpace::bivector >

◆ META::BaseClass< Eagle::PhysicalSpace::point >

struct META::BaseClass< Eagle::PhysicalSpace::point >

◆ META::BaseClass< Eagle::PhysicalSpace::vector >

struct META::BaseClass< Eagle::PhysicalSpace::vector >

◆ META::BaseClass< Eagle::point3f >

struct META::BaseClass< Eagle::point3f >

◆ META::BaseClass< Eagle::rgba_float_t >

struct META::BaseClass< Eagle::rgba_float_t >

◆ META::BaseClass< Eagle::vector3f >

struct META::BaseClass< Eagle::vector3f >

◆ META::BaseClass< Eagle::Vector< T, n > >

struct META::BaseClass< Eagle::Vector< T, n > >
template<class T, Eagle::dimension_t n>
struct META::BaseClass< Eagle::Vector< T, n > >

◆ META::has_member

class META::has_member
template<class...>
class META::has_member<... >

◆ META::has_member_template

struct META::has_member_template
template<class T, T>
struct META::has_member_template< T, T >

◆ META::IF

struct META::IF
template<bool condition, class A, class B>
struct META::IF< condition, A, B >

IF Metatemplate, used to compute a certain type based on the condition.

Usage:

 IF< (34<67), int, float> myType;
Class Members
typedef A result The result of the IF condition.

◆ META::IF< false, A, B >

struct META::IF< false, A, B >
template<class A, class B>
struct META::IF< false, A, B >

◆ META::LIST

class META::LIST
template<typename Type, class NEXT = NIL, class ... Types>
class META::LIST< Type, NEXT, Types >

Single Linked LIST Metatemplate.

Parameters
TypeThe list element (a type)
NEXTThe rest of the list Usage:
Single Linked LIST Metatemplate.
Definition LIST.hpp:25
Class Members
typedef NEXT next The next list entry (a type as well)
typedef Type type The current list entry (a type)

◆ META::META_VOID

struct META::META_VOID

◆ META::NIL

struct META::NIL

Typedef Documentation

◆ enable_if_callable_t

template<typename T , typename ... Args>
using META::enable_if_callable_t = typedef typename std::enable_if< is_callable<T,Args...>::value, is_callable_t<T,Args...> >::type

SFINAE for any callable T.

Represents the functions return-type;

Usage:

template<typename T, typename... Args>
static enable_if_callable_t<T,Args...>
call( T&&obj, Args... args )
{
return obj( forward<Args>(args)... );
}
enable_if_callable_t< T, Args... > call(T &&obj, Args &&... args)
Tempate to call a T if it's callable like a function (functor and functions).
Definition is_callable.hpp:102
typename std::enable_if< is_callable< T, Args... >::value, is_callable_t< T, Args... > >::type enable_if_callable_t
SFINAE for any callable T.
Definition is_callable.hpp:73
Author
Jan Wosnitza, Werner Benger

Function Documentation

◆ call()

template<typename T , typename... Args>
enable_if_callable_t< T, Args... > META::call ( T &&  obj,
Args &&...  args 
)
inline

Tempate to call a T if it's callable like a function (functor and functions).

Otherwise does nothing.

Usage:

void answerToAllAndEverything( double )
{
cout << "42" << endl;
}
void main()
{
cout << call( [](int i){ return i * 2; }, 21 ) << endl; // prints: 42
call( &answerToAllAndEverything, 42 ); // prints nothing
}
Author
Jan Wosnitza, Werner Benger

◆ declvals()

template<class T = META_VOID, class... Others>
std::remove_reference< T >::type && META::declvals ( )

Simple version of: std::forward<T>(std::declval<T>()) And enables to pop the first member of the variadic template argument.

Usage:

template <class... Params>
void f()
{
callOtherFunction( declvals<Params...>() ); // "genereates" instance of first param
callOtherFunction( declvals<Params>()... ); // "genereates" instance of all params
}
Author
Jan Wosnitza, Werner Benger