|
Boost : |
From: jk_at_[hidden]
Date: 2002-01-17 00:48:30
16 Jan 2002 21:27:44 +0300 Mac Murrett wrote:
>You are both correct on this one, I had not thought of it this way. This
>would make the implementation:
>
>template<class Return_Type, class Argument_Type>
>inline Return_Type &force_cast(const Argument_Type &rSrc)
> { return(*reinterpret_cast<const Return_Type *>(&rSrc)); }
If you want mutable Return_Type&, then Argument_Type& should be mutable
too; if the input argument is const&, then result must be const
reference too.
-- jk
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk