Bjorn Reese wrote
I am not sure I follow you. Are you saying that the following does not compile?
template <typename T> void foo(const T& t) {}
int main() { foo(42); int x = 42; foo(x); return 0; }
I meant that following won't compile template <typename T> void foo(const T& t) {} int main() { foo(42); return 0; } I just tried to compile this and now I see I was wrong about this. I knew that template <typename T> void foo( T & t) {} int main() { foo(42); return 0; } doesn't compile. To me this always made sense since it doesn't make much sense to take the address of something which is about to disappear regardless of whether it's "const" or now. My fix was to use void foo(T && t) which made sense to me - but of course not available until now. So make a trac ticket and I'll get around to addressing this. Robert Ramey -- View this message in context: http://boost.2283326.n4.nabble.com/serialization-Passing-literals-to-oarchiv... Sent from the Boost - Dev mailing list archive at Nabble.com.