diff options
author | John Wiegley <johnw@newartisans.com> | 2012-02-10 20:08:50 -1000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-02-17 15:09:32 -0600 |
commit | f322769775e2ff8b316336e5791060fb38f31450 (patch) | |
tree | bc35926462518fd5c6169ed14e9d5007bdd0b86f /src/value.h | |
parent | 8887fe9fa9bf8273573b4bc03d221b7b103cee75 (diff) | |
download | fork-ledger-f322769775e2ff8b316336e5791060fb38f31450.tar.gz fork-ledger-f322769775e2ff8b316336e5791060fb38f31450.tar.bz2 fork-ledger-f322769775e2ff8b316336e5791060fb38f31450.zip |
Added value_t::to_size_t method
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/value.h b/src/value.h index 9dd18623..f8495002 100644 --- a/src/value.h +++ b/src/value.h @@ -775,16 +775,17 @@ public: * its underlying type, where possible. If not possible, an * exception is thrown. */ - bool to_boolean() const; - int to_int() const; - long to_long() const; - datetime_t to_datetime() const; - date_t to_date() const; - amount_t to_amount() const; - balance_t to_balance() const; - string to_string() const; - mask_t to_mask() const; - sequence_t to_sequence() const; + bool to_boolean() const; + int to_int() const; + long to_long() const; + std::size_t to_size_t() const { return static_cast<std::size_t>(to_long()); } + datetime_t to_datetime() const; + date_t to_date() const; + amount_t to_amount() const; + balance_t to_balance() const; + string to_string() const; + mask_t to_mask() const; + sequence_t to_sequence() const; /** * Dynamic typing conversion methods. |