Opm::ConditionalStorage< cond, T > Class Template Reference

A simple class which only stores a given member attribute if a boolean condition is true. More...

#include <ConditionalStorage.hpp>

Inheritance diagram for Opm::ConditionalStorage< cond, T >:
Inheritance graph

Public Types

typedef T type
 

Public Member Functions

 ConditionalStorage ()
 
 ConditionalStorage (const T &v)
 
 ConditionalStorage (T &&v)
 
template<class ... Args>
 ConditionalStorage (Args... args)
 
 ConditionalStorage (const ConditionalStorage &t)
 
 ConditionalStorage (ConditionalStorage &&t)
 
ConditionalStorageoperator= (const ConditionalStorage &v)
 
ConditionalStorageoperator= (ConditionalStorage &&v)
 
const T & operator* () const
 
T & operator* ()
 
const T * operator-> () const
 
T * operator-> ()
 

Static Public Attributes

static constexpr bool condition = cond
 

Detailed Description

template<bool cond, class T>
class Opm::ConditionalStorage< cond, T >

A simple class which only stores a given member attribute if a boolean condition is true.

If the condition is false, nothing is stored and an exception is thrown when trying to access the object.

Member Typedef Documentation

◆ type

template<bool cond, class T >
typedef T Opm::ConditionalStorage< cond, T >::type

Constructor & Destructor Documentation

◆ ConditionalStorage() [1/6]

template<bool cond, class T >
Opm::ConditionalStorage< cond, T >::ConditionalStorage ( )
inline

◆ ConditionalStorage() [2/6]

template<bool cond, class T >
Opm::ConditionalStorage< cond, T >::ConditionalStorage ( const T &  v)
inline

◆ ConditionalStorage() [3/6]

template<bool cond, class T >
Opm::ConditionalStorage< cond, T >::ConditionalStorage ( T &&  v)
inline

◆ ConditionalStorage() [4/6]

template<bool cond, class T >
template<class ... Args>
Opm::ConditionalStorage< cond, T >::ConditionalStorage ( Args...  args)
inline

◆ ConditionalStorage() [5/6]

template<bool cond, class T >
Opm::ConditionalStorage< cond, T >::ConditionalStorage ( const ConditionalStorage< cond, T > &  t)
inline

◆ ConditionalStorage() [6/6]

template<bool cond, class T >
Opm::ConditionalStorage< cond, T >::ConditionalStorage ( ConditionalStorage< cond, T > &&  t)
inline

Member Function Documentation

◆ operator*() [1/2]

template<bool cond, class T >
T & Opm::ConditionalStorage< cond, T >::operator* ( )
inline

◆ operator*() [2/2]

template<bool cond, class T >
const T & Opm::ConditionalStorage< cond, T >::operator* ( ) const
inline

◆ operator->() [1/2]

template<bool cond, class T >
T * Opm::ConditionalStorage< cond, T >::operator-> ( )
inline

◆ operator->() [2/2]

template<bool cond, class T >
const T * Opm::ConditionalStorage< cond, T >::operator-> ( ) const
inline

◆ operator=() [1/2]

template<bool cond, class T >
ConditionalStorage & Opm::ConditionalStorage< cond, T >::operator= ( ConditionalStorage< cond, T > &&  v)
inline

◆ operator=() [2/2]

template<bool cond, class T >
ConditionalStorage & Opm::ConditionalStorage< cond, T >::operator= ( const ConditionalStorage< cond, T > &  v)
inline

Member Data Documentation

◆ condition

template<bool cond, class T >
constexpr bool Opm::ConditionalStorage< cond, T >::condition = cond
staticconstexpr

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