return *this;
}
+private:
template<typename T>
- T &value() const
+ Store<typename RemoveConst<T>::Type> *get_typed_store() const
{
typedef typename RemoveConst<T>::Type NCT;
Store<NCT> *s = dynamic_cast<Store<NCT> *>(store);
if(!s)
throw type_mismatch(typeid(T), (store ? store->type_id() : typeid(void)));
- return s->data;
+ return s;
+ }
+
+public:
+ template<typename T>
+ T &value()
+ {
+ return get_typed_store<T>()->data;
+ }
+
+ template<typename T>
+ const T &value() const
+ {
+ return get_typed_store<T>()->data;
}
template<typename T>