Honeycomb  0.1
Component-Model Framework
Classes | Namespaces | Macros | Typedefs | Functions
Meta.h File Reference
#include "Honey/Core/Preprocessor.h"
Include dependency graph for Meta.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  honey::mt::identity< T >
 Returns type T unchanged. More...
 
struct  honey::mt::True<... >
 Always returns true. Can be used to force a clause to be type dependent. More...
 
struct  honey::mt::True_int<... >
 Variant of True for integers. More...
 
struct  honey::mt::Void
 Special void type, use where void is intended but implicit members are required (default ctor, copyable, etc.) More...
 
struct  honey::mt::tag< int >
 Use to differentiate an overloaded function by type. Accepts dummy parameter default value: func(tag<0> = 0) More...
 
struct  honey::mt::conditional_int< b, t, f >
 Variant of std::conditional for integers, stores result in value More...
 
struct  honey::mt::conditional_int< true, t, f >
 
struct  honey::mt::is_base_of< Base, Derived >
 Version of std::is_base_of that removes reference qualifiers before testing. More...
 
struct  honey::mt::isSpecializationOf< T, Template >
 Check if T is a specialization of Template. More...
 
struct  honey::mt::isSpecializationOf< Template< Param... >, Template >
 
class  honey::mt::isCallable< Func, Args >
 Check if functor is callable with arguments. More...
 
class  honey::mt::funcTraits< T >
 Get function type traits. More...
 
struct  honey::mt::FuncptrBase
 Inherit to enable non-virtual functor calling. More...
 
struct  honey::mt::Funcptr< Sig >
 
struct  honey::mt::Funcptr< R(Args...)>
 Holds a function pointer so that a functor can be called non-virtually. The functor must inherit from FuncptrBase. More...
 
struct  honey::mt::Funcptr< void(Args...)>
 Specialization for void return type. More...
 
struct  honey::mt::NoCopy
 Inherit to declare that class is not copyable. More...
 
class  honey::mt::min< vals >
 Get minimum of all arguments. More...
 
struct  honey::mt::min< val, vals... >
 
struct  honey::mt::min< val >
 
class  honey::mt::max< vals >
 Get maximum of all arguments. More...
 
struct  honey::mt::max< val, vals... >
 
struct  honey::mt::max< val >
 
struct  honey::mt::log2Floor< x >
 Calc log base 2 of unsigned integer, rounded down to nearest integer. Returns -1 if x is zero. More...
 
struct  honey::mt::log2Floor< 0 >
 
struct  honey::mt::gcd< a, b >
 Calc greatest common divisor of a and b. More...
 
struct  honey::mt::gcd< a, 0 >
 
struct  honey::mt::gcd< 0, b >
 
class  honey::mt::funcTraits< T >
 Get function type traits. More...
 

Namespaces

 honey
 Global Honeycomb namespace.
 
 honey::mt
 Meta-programming and compile-time util.
 

Macros

#define mt_unused(Param)    (void)Param;
 Remove the unused parameter warning. More...
 
#define mt_unpackEval(...)    mt::pass(((__VA_ARGS__), 0)...)
 Unpack and evaluate a parameter pack expression. Ex. void foo(Args... args) { mt_unpackEval(func(args)); } More...
 
#define mt_hasMember(MemberName)    mt_hasMember2(MemberName, MemberName)
 Create a method to check if a class has a member with matching name and type. More...
 
#define mt_hasMember2(MemberName, TestName)
 
#define mt_hasType(TypeName)    mt_hasType2(TypeName, TypeName)
 Create a method to check if a class has a nested type/class. More...
 
#define mt_hasType2(TypeName, TestName)
 
#define mt_global(Class, Func, Ctor)    inline UNBRACKET(Class)& Func() { static UNBRACKET(Class) obj Ctor; return obj; }
 Create a global object that will be initialized upon first access, so it can be accessed safely from a static context. More...
 

Typedefs

template<class T , T val>
using honey::mt::Value = std::integral_constant< T, val >
 Holds a constant integral value. More...
 
template<class T >
using honey::mt::isTrue = Value< bool, std::is_same< T, std::true_type >::value >
 Check if type is std::true_type. More...
 
template<class T >
using honey::mt::addRef = std::add_lvalue_reference< T >
 Add reference to type. More...
 
template<class T >
using honey::mt::removeRef = std::remove_reference< T >
 Remove reference from type. More...
 
template<class T >
using honey::mt::addPtr = std::add_pointer< T >
 Add pointer to type. More...
 
template<class T >
using honey::mt::removePtr = std::remove_pointer< T >
 Remove pointer from type. More...
 
template<class T >
using honey::mt::addConstRef = addRef< typename std::add_const< T >::type >
 Add top-level const qualifier and reference to type. Use std::decay to remove top-level const/ref. More...
 
template<class T >
using honey::mt::isLref = Value< bool, std::is_lvalue_reference< T >::value >
 Check if type is an lvalue reference. More...
 
template<class T >
using honey::mt::isRref = Value< bool, std::is_rvalue_reference< T >::value >
 Check if type is an rvalue reference. More...
 
template<class T >
using honey::mt::isRef = Value< bool, std::is_reference< T >::value >
 Check if type is a reference. More...
 
template<class T >
using honey::mt::isPtr = Value< bool, std::is_pointer< T >::value >
 Check if type is a pointer. More...
 
template<bool b, class T = void>
using honey::mt::disable_if = std::enable_if<!b, T >
 Opposite of std::enable_if. More...
 
template<class T >
using honey::mt::isTuple = isSpecializationOf< typename std::decay< T >::type, tuple >
 Check if type is a tuple or a reference to one. More...
 
template<int I, class... Ts>
using honey::mt::typeAt = typename priv::typeAt< 0, I, Ts... >::type
 Get type at index of parameter pack. More...
 
template<class Match , class... Ts>
using honey::mt::typeIndex = priv::typeIndex< 0, Match, Ts... >
 Get index of first matching type in parameter pack, returns -1 if not found. More...
 
template<szt... Ints>
using honey::mt::idxseq = std::index_sequence< Ints... >
 Shorthand for std::index_sequence. More...
 
template<szt N>
using honey::mt::make_idxseq = std::make_index_sequence< N >
 Shorthand for std::make_index_sequence. More...
 
template<class Array >
using honey::mt::arraySize = Value< szt, sizeof(Array)/sizeof(typename Array::value_type)>
 Get size (number of elements) of a std::array. More...
 
template<class T >
using honey::mt::isIterator = priv::isIterator< typename removeRef< T >::type >
 Check if type is an iterator or a reference to one. An iterator is a type that has member iterator_category or is a pointer. More...
 
template<int64 val>
using honey::mt::abs = Value< int64,(val< 0)?-val:val >
 Get the absolute value of a number. More...
 
template<int64 val>
using honey::mt::sign = Value< int64,(val< 0)?-1:1 >
 Get the sign of a number. More...
 

Functions

template<class... Args>
void honey::mt::pass (Args...)
 Do nothing, can be used to evaluate an unpack expression. More...
 
template<class Func , class Tuple >
auto honey::mt::applyTuple (Func &&f, Tuple &&t)
 Call a function with arguments from an unpacked tuple. ie. f(get<Indices>(t)...) More...
 
template<class T , class... Ts>
auto honey::mt::make_array (T &&t, Ts &&...ts) -> array< T, sizeof...(Ts)+1 >
 Create an array of deduced type initialized with values. More...
 
void honey::mt::exec ()
 
template<class Func , class... Funcs>
void honey::mt::exec (Func &&f, Funcs &&...fs)
 Execute a list of functions. Use to expand parameter packs in arbitrary statements: exec([&]() { accum += get<Seq>(tuple); }...). More...
 
template<int64 begin, int64 end, int64 step = 1, class Func , class... Args, typename std::enable_if< begin==end, int >::type = 0>
void honey::mt::for_ (Func &&f, Args &&...args)
 Unroll a loop calling f(counter, args...) at each iteration. More...
 
template<class F , class Sig = typename funcTraits<typename removeRef<F>::type>::Sig>
Funcptr< Sig > honey::mt::FuncptrCreate (F &&f)
 Convenient method to create a Funcptr from a functor that inherits from FuncptrBase. More...