From 18aaf588ab55dfef5556e27ab69491f4c77ad303 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 30 Apr 2007 12:20:58 +0000 Subject: Added use of boost::optional<> to amount.h --- src/balance.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/balance.h') diff --git a/src/balance.h b/src/balance.h index 2a6f3072..e8665335 100644 --- a/src/balance.h +++ b/src/balance.h @@ -435,8 +435,10 @@ class balance_t amount_t amount(const commodity_t& commodity = *commodity_t::null_commodity) const; balance_t value(const moment_t& moment = now) const; - balance_t price() const; - moment_t date() const; + + optional price() const; + optional date() const; + optional tag() const; balance_t strip_annotations(const bool keep_price = amount_t::keep_price, @@ -896,12 +898,16 @@ class balance_pair_t balance_t value(const moment_t& moment = now) const { return quantity.value(moment); } - balance_t price() const { + + optional price() const { return quantity.price(); } - moment_t date() const { + optional date() const { return quantity.date(); } + optional tag() const { + return quantity.tag(); + } balance_t strip_annotations(const bool keep_price = amount_t::keep_price, -- cgit v1.2.3