#include <iomanip>
#include <istream>
#include <locale>
#include <ostream>
#include <sstream>
#include <string>
#include <stdexcept>
#include "ioflags.hpp"
#include "fixed.hpp"
#include "rational.hpp"
Go to the source code of this file.
Classes | |
class | currency< T, N > |
Functions | |
template<class T, int N, class Char, class Traits> | |
std::basic_istream < Char, Traits > & | operator>> (std::basic_istream< Char, Traits > &strm, currency< T, N > &c) |
template<class T, int N, class Char, class Traits> | |
std::basic_ostream < Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &strm, currency< T, N > c) |
template<class T, int N> | |
currency< T, N > | operator- (currency< T, N > a) |
Negate a currency value. | |
template<class T, int N> | |
currency< T, N > | operator+ (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
currency< T, N > | operator- (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
currency< T, N > | operator * (currency< T, N > a, T b) |
template<class T, int N> | |
currency< T, N > | operator * (T a, currency< T, N > b) |
template<class T, int N> | |
currency< T, N > | operator/ (currency< T, N > a, T b) |
template<class T, int N> | |
rational< T > | operator/ (currency< T, N > n, currency< T, N > d) |
template<class T, int N> | |
bool | operator== (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
bool | operator== (currency< T, N > a, T b) |
template<class T, int N> | |
bool | operator== (T a, currency< T, N > b) |
template<class T, int N> | |
bool | operator!= (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
bool | operator!= (currency< T, N > a, T b) |
template<class T, int N> | |
bool | operator!= (T a, currency< T, N > b) |
template<class T, int N> | |
bool | operator< (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
bool | operator< (currency< T, N > a, T b) |
template<class T, int N> | |
bool | operator< (T a, currency< T, N > b) |
template<class T, int N> | |
bool | operator> (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
bool | operator> (currency< T, N > a, T b) |
template<class T, int N> | |
bool | operator> (T a, currency< T, N > b) |
template<class T, int N> | |
bool | operator<= (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
bool | operator<= (currency< T, N > a, T b) |
template<class T, int N> | |
bool | operator<= (T a, currency< T, N > b) |
template<class T, int N> | |
bool | operator>= (currency< T, N > a, currency< T, N > b) |
template<class T, int N> | |
bool | operator>= (currency< T, N > a, T b) |
template<class T, int N> | |
bool | operator>= (T a, currency< T, N > b) |
Definition in file currency.hpp.
Multiply currency value and an integer
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 314 of file currency.hpp.
Multiply currency value and an integer
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 304 of file currency.hpp.
bool operator!= | ( | T | a, | |
currency< T, N > | b | |||
) | [inline] |
Compare currency value and an integer for inequality
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 387 of file currency.hpp.
bool operator!= | ( | currency< T, N > | a, | |
T | b | |||
) | [inline] |
Compare currency value and an integer for inequality
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 379 of file currency.hpp.
Compare currency values for inequality.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 371 of file currency.hpp.
currency<T,N> operator+ | ( | currency< T, N > | a, | |
currency< T, N > | b | |||
) | [inline] |
Add currency values
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 284 of file currency.hpp.
currency<T,N> operator- | ( | currency< T, N > | a, | |
currency< T, N > | b | |||
) | [inline] |
Subtract currency values
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 294 of file currency.hpp.
Divide currency values to yield a rational result.
n | the numerator | |
d | the denominator |
Definition at line 334 of file currency.hpp.
References fixed< T, N >::value(), and currency< T, N >::value().
Divide currency value by an integer
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 324 of file currency.hpp.
bool operator< | ( | T | a, | |
currency< T, N > | b | |||
) | [inline] |
Compare a currency value and an integer for less-than.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 412 of file currency.hpp.
bool operator< | ( | currency< T, N > | a, | |
T | b | |||
) | [inline] |
Compare a currency value and an integer for less-than.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 404 of file currency.hpp.
Compare currency values for less-than by comparing the underlying values.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 396 of file currency.hpp.
std::basic_ostream<Char, Traits>& operator<< | ( | std::basic_ostream< Char, Traits > & | strm, | |
currency< T, N > | c | |||
) | [inline] |
Write a currency value
strm | The output stream | |
c | The value to write |
Definition at line 265 of file currency.hpp.
bool operator<= | ( | T | a, | |
currency< T, N > | b | |||
) | [inline] |
Compare a currency value and an integer for less-than-or-equal.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 462 of file currency.hpp.
bool operator<= | ( | currency< T, N > | a, | |
T | b | |||
) | [inline] |
Compare a currency value and an integer for less-than-or-equal.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 454 of file currency.hpp.
Compare currency values for less-than-or-equal.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 446 of file currency.hpp.
bool operator== | ( | T | a, | |
currency< T, N > | b | |||
) | [inline] |
Compare currency value and an integer for equality
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 362 of file currency.hpp.
References currency< T, N >::value().
bool operator== | ( | currency< T, N > | a, | |
T | b | |||
) | [inline] |
Compare currency value and an integer for equality
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 354 of file currency.hpp.
References currency< T, N >::value().
Compare currency values for equality by comparing the underlying values.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 346 of file currency.hpp.
References currency< T, N >::value().
bool operator> | ( | T | a, | |
currency< T, N > | b | |||
) | [inline] |
Compare a currency value and an integer for greater-than.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 437 of file currency.hpp.
bool operator> | ( | currency< T, N > | a, | |
T | b | |||
) | [inline] |
Compare a currency value and an integer for greater-than.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 429 of file currency.hpp.
Compare currency values for greater-than.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 421 of file currency.hpp.
bool operator>= | ( | T | a, | |
currency< T, N > | b | |||
) | [inline] |
Compare a currency value and an integer for greater-than-or-equal.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 487 of file currency.hpp.
bool operator>= | ( | currency< T, N > | a, | |
T | b | |||
) | [inline] |
Compare a currency value and an integer for greater-than-or-equal.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 479 of file currency.hpp.
Compare currency values for greater-than-or-equal.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 471 of file currency.hpp.
std::basic_istream<Char, Traits>& operator>> | ( | std::basic_istream< Char, Traits > & | strm, | |
currency< T, N > & | c | |||
) | [inline] |
Read a currency value
strm | The input stream | |
[out] | c | Store the value here |
Definition at line 254 of file currency.hpp.
References currency< T, N >::read().