2 * Copyright (c) 2001 by Peter Simons <simons@cryp.to>.
6 #ifndef RESETABLE_VARIABLE_H
7 #define RESETABLE_VARIABLE_H
9 // This is a wrapper class about variables where you want to keep
10 // track of whether it has been assigened yet or not.
18 RESETABLE() : value(), is_set(false) {}
19 explicit RESETABLE(const T & v) : value(v), is_set(true) {}
21 RESETABLE<T> & operator=(const T & rhs)
28 const T & const_data() const throw() { return value; }
29 T & data() throw() { return value; }
30 const T & data() const throw() { return value; }
31 bool empty() const throw() { return !is_set; }
32 void reset() throw() { is_set = false; }
33 void splice(const RESETABLE<T> & rhs)
41 void maybeSet(value_type& dest) const
52 #endif // RESETABLE_VARIABLE_H