Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Public Member Functions | List of all members
read_only< T > Class Template Reference

A copyable read-only value. More...

#include <read_only.h>

Public Member Functions

 read_only ()
 
 read_only (const T &value)
 
bool has_value () const
 
const T & get_value () const
 
void operator= (const T &value)
 

Detailed Description

template<class T>
class read_only< T >

A copyable read-only value.

Writing a const member variable causes the need to write a custom copy constructor. Using this class instead prevents this.

Constructor & Destructor Documentation

◆ read_only() [1/2]

template<class T >
read_only< T >::read_only ( )
inline

◆ read_only() [2/2]

template<class T >
read_only< T >::read_only ( const T &  value)
inline

Member Function Documentation

◆ get_value()

template<class T >
const T & read_only< T >::get_value ( ) const
inline

◆ has_value()

template<class T >
bool read_only< T >::has_value ( ) const
inline

◆ operator=()

template<class T >
void read_only< T >::operator= ( const T &  value)
inline

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