The Sparta Modeling Framework
|
File that defines compile-time queries on data types. Extends c++11+'s trait types. More...
#include <type_traits>
Go to the source code of this file.
Classes | |
class | sparta_traits< T > |
Functions | |
template<class value_type > | |
static std::enable_if< sparta_traits< value_type >::is_smartptr==false, constvalue_type * >::type | getAsPointer (const value_type &obj) |
getAsPointer Intended to convert what object is given to a pointer type | |
template<class value_type > | |
static std::enable_if< sparta_traits< value_type >::is_smartptr==true, consttypenamevalue_type::element_type * >::type | getAsPointer (const value_type &obj) |
getAsPointer Intended to convert what object is given to a pointer type | |
File that defines compile-time queries on data types. Extends c++11+'s trait types.
Definition in file Traits.hpp.
|
inlinestatic |
getAsPointer Intended to convert what object is given to a pointer type
obj | The object to convert to a pointer |
value_type | The type of the object |
This version of the function will evaluate the value_type to see if it's NOT a smart pointer type (like a unique_ptr or a shared_ptr) and will return the given object as an address
Definition at line 54 of file Traits.hpp.
|
inlinestatic |
getAsPointer Intended to convert what object is given to a pointer type
obj | The object to convert to a pointer |
value_type | The type of the object |
This version of the function will evaluate the value_type to see if it IS a smart pointer type (like a unique_ptr or a shared_ptr) and will return the given object as an address via the smart pointer's get()
method.
Definition at line 72 of file Traits.hpp.