[compressed pair] Borland patch

Borland does not like the new version of compressed pair. It turns out it cannot handle static_cast-ing a class to reference to private base, although it will allow implicit conversion. Hence the patch simply drops the casts on the Borland compilers: cvs diff -wb -- boost\detail\compressed_pair.hpp (in directory E:\sourceforge\devel\boost\) Index: boost/detail/compressed_pair.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/detail/compressed_pair.hpp,v retrieving revision 1.13 diff -w -b -r1.13 compressed_pair.hpp 157a158,161
-- AlisdairM

From: AlisdairM
Borland does not like the new version of compressed pair.
That's a pity... OTOH with Borland 5.6.4 it compiles fine.
I think this should rather be: #if BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x846)) #define BOOST_PRIVATE_BASE_CAST(type, arg) static_cast<type>(arg) #else #define BOOST_PRIVATE_BASE_CAST(type, arg) (arg) #endif And later in the appropriate lines: first_reference first() { return BOOST_PRIVATE_BASE_CAST(first_reference, *this); } first_const_reference first() const { return BOOST_PRIVATE_BASE_CAST(first_const_reference, *this); } Best regards, Robert

Robert Kawulak wrote:
That's a pity... OTOH with Borland 5.6.4 it compiles fine.
The problem showed up in metacomm regressions last night, so I believe the problem is present in 5.6.4 too. There also seems to be some link to whether the 'zero size base class' compiler option is enabled, which seems a strange to produce a front-end rather than back-end error. The proposed patch should solve problem regardless of compiler version, or selected options. If the same patch is needed for DMC I agree naming it once, rather than compiler-detecting each time, makes sense. Personally I find the WORKAROUND clearer than having a function-like macro expand to the right thing, but that is the library maintainers choice ;?) -- AlisdairM

"AlisdairM" <alisdair.meredith@uk.renaultf1.com> writes:
Alisdair, it's a bit nicer if you can use diff -dbu, or -du. Unified diffs are easier to understand, and while -b sometimes loses indentation, -w can miss crucial changes. In any case there's not much point in using -w and -b together, is there? nanny-ly y'rs, Dave -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
AlisdairM
-
David Abrahams
-
Robert Kawulak