If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Boost Lexical Cast

I can confirm the error with Boost 1.47.0 and GLM 0.9.2.7 when compiling on g++ 4.4.5 using your test program. A "manual" version that uses a stringstream directly works even with the Boost.PropertyTree header file included, so my guess is that this is a bug with boost::lexical_cast.

Re: Boost Lexical Cast

Oh, on a hunch, from a past discussion on the Boost developers list concerning an input manipulator I once proposed, I suspected that argument dependent lookup was working against you, and a quick check seems to show that I am right. Try:

Re: Boost Lexical Cast

Originally Posted by Chris_F

I have no idea (yet) what argument dependent lookup is, but that sure seems to be the problem and solution.

Basically, as the call of operator>> within lexical_cast is unqualified, the name lookup also considers namespaces that the types of the arguments are from. As such, to overload operator>> for glm:etail::tvec2<T> to read from input streams, it is best to do so within the glm:etail namespace. Unfortunately, that namespace is reserved, by convention, to GLM developers working on GLM implementation detail.