MAiNGO
babBase::OutVar< T > Class Template Reference

Helper class that can be used to enforce the caller to explicitly state that the variable he passed may be changed. More...

#include <babUtils.h>

Public Types

typedef T type
 

Public Member Functions

 OutVar (T &ref) noexcept
 
 OutVar (T &&)=delete
 
 OutVar (const OutVar &) noexcept=default
 
OutVaroperator= (const OutVar &x) noexcept=default
 
 operator T & () const noexcept
 
T & get () const noexcept
 

Private Attributes

T * _ptr
 

Detailed Description

template<class T>
class babBase::OutVar< T >

Helper class that can be used to enforce the caller to explicitly state that the variable he passed may be changed.

Use as int a=3; foo(out_par(a)); or foo(OutVar<int>(a));

Member Typedef Documentation

◆ type

template<class T >
typedef T babBase::OutVar< T >::type

type of OutVar

Constructor & Destructor Documentation

◆ OutVar() [1/3]

template<class T >
babBase::OutVar< T >::OutVar ( T &  ref)
inlineexplicitnoexcept

Copy

◆ OutVar() [2/3]

template<class T >
babBase::OutVar< T >::OutVar ( T &&  )
delete

Don't use r-value copy constructor

◆ OutVar() [3/3]

template<class T >
babBase::OutVar< T >::OutVar ( const OutVar< T > &  )
defaultnoexcept

Use default copy constructor

Member Function Documentation

◆ get()

template<class T >
T& babBase::OutVar< T >::get ( ) const
inlinenoexcept

Get reference

◆ operator T &()

template<class T >
babBase::OutVar< T >::operator T & ( ) const
inlinenoexcept

Access via ()

◆ operator=()

template<class T >
OutVar& babBase::OutVar< T >::operator= ( const OutVar< T > &  x)
defaultnoexcept

Use default assignment

Member Data Documentation

◆ _ptr

template<class T >
T* babBase::OutVar< T >::_ptr
private

Pointer to object of type T


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