Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::lexical_cast: where to declare operator<<
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-09-07 10:49:17


AMDG

On 09/07/2011 02:03 AM, Nagaev Boris wrote:
> I'm implementing boost::lexical_cast for class A.
> When operator<< is declared in the same namespace, as class A, it works:
>
> <snip>
>
> But if operator<< is declared in root namespace, it will not compile:
>

That's how name lookup works in templates.
operator<< has to be in a namespace associated
with A.

In Christ,
Steven Watanabe




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net