Joel de Guzman wrote:

Hmm... the same problem can be seen if you try

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");

Yes, but a library can make it work. For instance, make_tuple("hello, ", "world") works as expected. QOI matter?
I guess so. (Hmm.. I recall that the proposes solution for std::pair is to make it accept value, not reference, and don't know the motivation, except that this solution is the simplest)

// Arrays can't be stored as plain types; convert them to references.

template<class T, int n> struct make_tuple_traits <T[n]> {
typedef const T (&type)[n];
};
Wait a minute! If T[n] is converted to T[n]&, then it would mean
make_tuple("1", "2") and make_tuple("1", "23") will generate different
template specializations? I'd rather convert T[n] to T*, but probably I
miss something.

- Volodya

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to