I keep getting a bad_any_cast exception when I retrieve data from a map.
Basically:
class DataType {
//protected:
public:
boost::any value_;
DataType(){};
template <class type>
DataType(type& value) : value_(value) {};
template <class type>
DataType(const type& value) : value_(value) {};
// Provide constant & non constant version of operator =
template <class type>
type& operator=(type &rhs) {
value_=rhs;
return rhs;
};
template <typename type>
const type& operator= (const type& rhs) {
value_=rhs;
return rhs;
};
}
map
participants (2)
-
Dan Day
-
Joe McCay