
msvc gets the copy constructor and assignment operator wrong in the presence of a templated base class constructor/assignment operator.
You need to define them explicitly.
class Value : public boost::any { public: // <snip> Value(const Value& arg) : boost::any(static_cast
(arg)){} Value& operator=(const Value& arg) { static_cast (*this) = static_cast (arg); } };
thanks, I was trying to do about the same thing, but using reinterpret_cast, which also caused unrecoverable errors. I guess I'm not sure what the semantic difference between the two is, but that's probably a question for a different list and a different day. In the meantime, I made my type non-copyable, wrapped it in shared_ptrs which is faster anyway, and got it working that way. But your I definitely appreciate the answer since that would have been bugging me for days otherwise. mike