All pastes #2068492 Raw Edit

initialized

public cpp v1 · immutable
#2068492 ·published 2011-05-24 15:39 UTC
rendered paste body
template<typename T, T Value> class initialized{public:	initialized() : value_(Value) {}	initialized(const T &value) : value_(value) {}	initialized &operator =(const T &value) 	{		value_ = value;		return *this;	}	operator T() 	{ 		return value_; 	}	const T &value() const	{		return value_;	}private:	T value_;};