LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar::util::details::dereference_class< T, CanDereference > Struct Template Reference

Functor returning the dereferenced value of the argument. More...

#include "Dereference.h"

Public Types

using argument_type = T
 
using reference_type = typename std::add_lvalue_reference< typename dereferenced_type< T, CanDereference >::type >::type
 

Public Member Functions

reference_type operator() (argument_type &ref) const
 

Detailed Description

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

Functor returning the dereferenced value of the argument.

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

The functor defines a call operator returning:

  1. a reference to the value pointed by the argument (CanDereference)
  2. or, a reference 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 125 of file Dereference.h.

Member Typedef Documentation

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

Definition at line 126 of file Dereference.h.

template<typename T , bool CanDereference>
using lar::util::details::dereference_class< T, CanDereference >::reference_type = typename std::add_lvalue_reference< typename dereferenced_type<T, CanDereference>::type>::type

Definition at line 128 of file Dereference.h.

Member Function Documentation

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

Definition at line 130 of file Dereference.h.

130 { return ref; }

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