10 #include <boost/noncopyable.hpp>
11 #include <boost/shared_ptr.hpp>
31 template<
typename ValueType>
39 : staging_(new ValueType()), current_(new ValueType()),
49 return (modified_ ? *staging_ : *current_);
56 *staging_ = new_value;
72 current_.reset(
new ValueType());
77 staging_.reset(
new ValueType());
93 operator const ValueType&()
const {
102 boost::shared_ptr<ValueType> staging_;
107 boost::shared_ptr<ValueType> current_;
118 #endif // STAGED_VALUE_H