Greg Dehaas wrote:
Hi All,
boost::any test = "Test Me";
[...]
Hmm... the same problem can be seen if you tryAnd the error message is: c:\dev\boost\boost\any.hpp(105) : error C2536: 'boost::any::holder<char [8]>::held' : cannot specify explicit initializer for arrays c:\dev\boost\boost\any.hpp(122) : see declaration of 'held' c:\dev\boost\boost\any.hpp(103) : while compiling class-template member function '__thiscall boost::any::holder<char [8]>::boost::any::holder<char [8]>(const char (&)[8])'
std::make_pair("1", "2");
the template parameters are deduces as char[1] and char[1], and there's no much you can do with that type, not even copy it. That's the way template
argument deduction works, IIRC. I suggest that you change ctors of any and
any::holder to take value instead of reference, and tell what you got. Of course, you should be able to say
boost::any test = static_cast<const char*>("Test me");
HTH,
Volodya
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost