Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-01-23 17:55:54


"Robert Kawulak" <tigrisek_at_[hidden]> writes:

> Hi,
>
> Recently I've discovered that Digital Mars compiler (version
> 8.42n) has problems when compiling boost::compressed_pair. The
> problem is in the member functions first() and second() in cases
> when compressed_pair is derived from either first or second type.
> To fix the problem, *this must be explicitly converted to the
> return type, so the functions would look like this:
>
> second_reference second() { return
> static_cast<second_reference>(*this); }

Should be boost::implicit_cast<second_reference>(*this);

> instead of the way they're implemented now:
>
> second_reference second() { return *this; }
>
> If the problem wasn't mentioned before, then I'd suggest to fix
> it. The solution is quite easy to introduce and AFAICT has no
> negative side effects. Does anybody object to this?

I don't object, but the obfuscation of the code is a negative side
effect.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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