Public Types | Public Member Functions | List of all members
lar::util::details::make_pointer_class< T, CanDereference > Struct Template Reference

Functor returning the pointer to a value in the argument. More...

#include <Dereference.h>

Public Types

using argument_type = T
 
using pointer_type = typename std::add_pointer< typename dereferenced_type< T, CanDereference >::type >::type
 

Public Member Functions

pointer_type operator() (argument_type &ref) const
 

Detailed Description

template<typename T, bool CanDereference>
struct lar::util::details::make_pointer_class< T, CanDereference >

Functor returning the pointer to a value in the argument.

Template Parameters
Ttype of the argument
CanDereferencewhether T can be dereferenced or not

The functor defines a call operator returning:

  1. a pointer to the value pointed by the argument (CanDereference), or
  2. a pointer to the argument itself (!CanDereference).

The behaviour is therefore determined by the CanDereference parameter. 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. It is used in association with has_dereference_class.

This class is state-less.

Definition at line 171 of file Dereference.h.

Member Typedef Documentation

template<typename T, bool CanDereference>
using lar::util::details::make_pointer_class< T, CanDereference >::argument_type = T

Definition at line 172 of file Dereference.h.

template<typename T, bool CanDereference>
using lar::util::details::make_pointer_class< T, CanDereference >::pointer_type = typename std::add_pointer <typename dereferenced_type<T, CanDereference>::type>::type

Definition at line 174 of file Dereference.h.

Member Function Documentation

template<typename T, bool CanDereference>
pointer_type lar::util::details::make_pointer_class< T, CanDereference >::operator() ( argument_type ref) const
inline

Definition at line 176 of file Dereference.h.

176 { return &ref; }

The documentation for this struct was generated from the following file: