Class holding the type dereferenced from an object of type T. More...
#include <Dereference.h>
Public Types | |
using | type = T |
Class holding the type dereferenced from an object of type T.
T | the type to be tested |
CanDereference | whether T can be dereferenced or not |
This class can be used as:
static_assert(std::is_same< typename dereferenced_type<int, false>::type, int >::value, "error"); static_assert(std::is_same< typename dereferenced_type<int*, true>::type, int& >::value, "error");
The type is contained in the type
member of the class. The type
is precisely what is obtained by dereferencing T (that is often a reference to a type). Note that the second parameter must express correctly whether the first type can be dereferenced or not. Clearly, this class is not very useful by itself, since we have to tell it how to do the trick (lar::util::dereferenced_type puts everything together). It is used in association with has_dereference_class.
The implementation is the usual two-definition one:
Definition at line 100 of file Dereference.h.
using lar::util::details::dereferenced_type< T, CanDereference >::type = T |
Definition at line 102 of file Dereference.h.