Helpers for type detection, type rewriting and metaprogramming.
This header is a collection of frequently used templates for working with types. It incurs only modest header inclusion overhead
- Warning
- be sure not to jeopardise that!
- unwrapping
- Strip away all kinds of type adornments, like const, reference, pointer, smart-ptr. The accompanying lib::meta::unwrap() function can be used to accept "stuff
packaged in various forms". The Strip template packages this ability in various degrees for metaprogramming
- Warning
- these helpers can be quite dangerous, as they silently break any protective barriers (including lifecycle managing smart-ptrs)
- string conversion
- a set of trait templates to categorise arbitrary types with respect to the ability for string conversions
- ability to iterate
- these traits can be used to build the notion of a generic container – basically anything that can be enumerated. Within Lumiera, we frequently use our own concept of "iterability", known as "Lumiera Forward Iterator". These helpers here allow to unify this concept with the "Range" concept from the standard library (
begin() and end())
- See also
- MetaUtils_test
-
format-obj.hpp string representation for anything
-
meta/util.hpp very basic metaprogramming helpers
-
typelist.hpp
Definition in file trait.hpp.
|
| struct | Unwrap< X > |
| | Helper for type analysis and convenience accessors: attempts to extract a base type from various wrappers. More...
|
| |
| struct | Unwrap< void > |
| | < More...
|
| |
| struct | Unwrap< X * > |
| |
| struct | Unwrap< boost::reference_wrapper< X > > |
| |
| struct | Unwrap< std::reference_wrapper< X > > |
| |
| struct | Unwrap< std::unique_ptr< X, D > > |
| |
| struct | Unwrap< std::shared_ptr< X > > |
| |
| struct | Unwrap< P< X, B > > |
| |
| struct | Strip< X > |
| | Helper for type analysis: tries to strip all kinds of type adornments. More...
|
| |
| struct | RefTraits< TY > |
| | Type definition helper for pointer and reference types. More...
|
| |
| struct | RefTraits< TY * > |
| |
| struct | RefTraits< TY & > |
| |
| struct | RefTraits< TY && > |
| |
| struct | is_basicallySame< T, U > |
| | compare unadorned types, disregarding const and references More...
|
| |
| struct | is_Subclass< S, I > |
| | verify compliance to an interface by subtype check More...
|
| |
| struct | is_basically< S, I > |
| | compare for unadorned base type, disregarding const and references More...
|
| |
| struct | can_StandIn< S, G > |
| | verify the first (special) type can stand-in for the second More...
|
| |
| struct | is_StringLike< X > |
| | detect various flavours of string / text data More...
|
| |
| struct | can_lexical2string< X > |
| | types able to be lexically converted to string representation More...
|
| |
| struct | use_LexicalConversion< X > |
| |
| struct | is_StreamSource< X > |
| |
| struct | use_StringConversion4Stream< X > |
| | when to use custom string conversions for output streams More...
|
| |
| struct | is_smart_ptr< X > |
| | detect smart pointers More...
|
| |
| struct | is_smart_ptr< std::shared_ptr< T > > |
| |
| struct | is_smart_ptr< std::unique_ptr< T, D > > |
| |
| struct | is_nonFloat< NUM > |
| |
| struct | is_narrowingInit< SRC, TAR > |
| | temporary workaround for GCC Bug-63723, necessary until CGG-5 More...
|
| |
| struct | is_narrowingInit< lib::hash::LuidH, TAR > |
| |
| class | can_IterForEach< T > |
| | Trait template to detect a type usable immediately as "Lumiera Forward Iterator" in a specialised for-each loop This is just a heuristic, based on some common properties of such iterators; it is enough to distinguish it from an STL container, but can certainly be refined. More...
|
| |
| class | is_StateCore< T > |
| | Trait template to detect a type exposing a »state core« API. More...
|
| |
| class | can_STL_ForEach< T > |
| | Trait template to detect a type usable with the STL for-each loop. More...
|
| |
| struct | can_STL_ForEach< T >::is_iterable |
| |
| struct | can_STL_ForEach< T >::is_noexcept_iterable |
| |
| struct | can_STL_ForEach< T >::is_const_iterable |
| |
| struct | can_STL_ForEach< T >::is_const_noexcept_iterable |
| |
| class | can_STL_backIteration< T > |
| | Trait template to detect a type also supporting STL-style backwards iteration. More...
|
| |
| struct | can_STL_backIteration< T >::is_backIterable |
| |
| struct | can_STL_backIteration< T >::is_noexcept_backIterable |
| |
| struct | can_STL_backIteration< T >::is_const_backIterable |
| |
| struct | can_STL_backIteration< T >::is_const_noexcept_backIterable |
| |