powerd++
0.4.4
|
A simple value container only allowing += and copy assignment. More...
#include <utility.hpp>
Public Member Functions | |
constexpr | Sum (T const &value) |
Construct from an initial value. More... | |
constexpr | Sum () |
Default construct. | |
constexpr | operator T const & () const |
Returns the current sum of values. More... | |
constexpr Sum & | operator+= (T const &value) |
Add a value to the sum. More... | |
Private Attributes | |
T | value |
The sum of values accumulated. | |
A simple value container only allowing += and copy assignment.
T | The value type |
|
inlineexplicitconstexpr |
Construct from an initial value.
value | The initial value |
|
inlineconstexpr |
Returns the current sum of values.
|
inlineconstexpr |
Add a value to the sum.
value | The value to add to the current sum |