Boost logo

Boost Users :

From: Johan Ericsson (johanericsson_at_[hidden])
Date: 2002-03-22 19:09:10


--- "Daniel T." <daniel_t_at_[hidden]> wrote:
> I noticed that the function declaration of
> lexical_cast is:
>
> template<typename Target, typename Source>
> Target lexical_cast(Source arg)
>
> Namely that arg is a copy of the original source. Is
> there a specific
> reason that a copy is made? Why isn't it a 'const
> Source&' instead?
>

I'll make a guess that it has to do with the double
reference problem. ie: the type of Source can be a
reference, so const Source& would be a double
reference...

Am I right?

Johan

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/


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