|
Boost : |
From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 1999-09-20 10:01:03
C. Green wrote:
> The principle to keep in mind is to define the most narrow casting
> functions that are as specific as possible.
Keep in mind that exact_cast<OriginalType, TargetType> (lvalue)
is the most specific cast possible, but maybe it's _too_
specific. Definition of exact_cast follows:
template <typename OriginalType, typename TargetType>
TargetType exact_cast (OriginalType& x)
{ return (TargetType)x; }
being too specific doesn't help either.
-- Valentin Bonnard
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk