Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2002-10-10 02:38:46


"David B. Held" wrote:
>
> "Daniel Frey" <daniel.frey_at_[hidden]> wrote in message
> news:3DA3FBD2.537AEC13_at_aixigo.de...
> > [...]
> > Why do you think that it will create a temporary? Consider:
> > [...]
>
> I was under the impression that the static_cast inside your conversion
> operator could create a temporary. If so, you have a real problem, as
> you're returning a ref to a temp.

Agreed, if it would return a reference to a temporary, I would have a
severe problem. But it was intended to do anything *but* create a
temporary. My tests showed that the static_cast< static_cast<
const_cast< > > > sequence produces an identical assembler output than
the reinterpret_cast for the operator (gcc 3.2) and I don't see any
reason why a temporary should/could be created.

Regards, Daniel

--
Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk