Re: [boost] [compressed pair] Borland patch

From: Robert Kawulak
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); }
I think I just found a better solution - if the base classes of compressed_pair_imp are protected instead of private, then DMC compiles this fine (and four other compilers I've tested too), and the code isn't cluttered with macros. Best regards, Robert

I think I just found a better solution - if the base classes of compressed_pair_imp are protected instead of private, then DMC compiles this fine (and four other compilers I've tested too), and the code isn't cluttered with macros.
Just to be clear about this: if I change the base classes to protected, and remove the explicit casts, then it works OK with DMC? If so that gets us almost back to the original code, and should work everywhere. John.

Hi,
From: John Maddock
Just to be clear about this: if I change the base classes to protected, and remove the explicit casts, then it works OK with DMC?
That's right, at least my tests with the latest DMC version confirm this.
If so that gets us almost back to the original code, and should work everywhere.
I hope so ;-) Best regards, Robert
participants (2)
-
John Maddock
-
Robert Kawulak