powerd++  0.4.4
Public Member Functions | Private Attributes | List of all members
utility::Max< T > Class Template Reference

A simple value container that provides the maximum of assigned values. More...

#include <utility.hpp>

Collaboration diagram for utility::Max< T >:
[legend]

Public Member Functions

constexpr Max (T const &value)
 Construct from an initial value. More...
 
constexpr operator T const & () const
 Returns the current maximum. More...
 
constexpr Maxoperator= (T const &value)
 Assign a new value, if it is greater than the current value. More...
 

Private Attributes

value
 The maximum of the assigned values.
 

Detailed Description

template<typename T>
class utility::Max< T >

A simple value container that provides the maximum of assigned values.

Template Parameters
TThe value type

Constructor & Destructor Documentation

◆ Max()

template<typename T >
constexpr utility::Max< T >::Max ( T const &  value)
inlineexplicitconstexpr

Construct from an initial value.

Parameters
valueThe initial value

Member Function Documentation

◆ operator T const &()

template<typename T >
constexpr utility::Max< T >::operator T const & ( ) const
inlineconstexpr

Returns the current maximum.

Returns
The maximum by const reference

◆ operator=()

template<typename T >
constexpr Max& utility::Max< T >::operator= ( T const &  value)
inlineconstexpr

Assign a new value, if it is greater than the current value.

Parameters
valueThe value to assign
Returns
A self reference

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