[boost] [tuple] attempt to fix a BCB regression, and a plea for help

Hello, A couple of days ago I prompted about the status of a supposed regression on tuple_test_bench (http://tinyurl.com/62plc). The attached file (to be replacing boost/tuple/detail/tuple_basic.hpp) is an (unsuccesful) attempt to fix the problem, which is related to the inability of BCB to cope with element<N,T> being specialized for T a const tuple type. AFAICS, the attached file should work (I've checked the workaround with other compilers), but BCB still doesn't like. Lacking the necessary BCB skills and tools, I'd appreciate if someone can take a look at it and, hopefully, turn it into a valid workaround for Borland. The relevant part is guarded by a "#if defined(__BORLANDC__)" directive. There are 14 regressions left in the main trunk, and if we all pull a little together, the long awaited Boost 1.32 release could be make real very soon. Thanks for the help. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

JOAQUIN LOPEZ MU?Z wrote:
AFAICS, the attached file should work (I've checked the workaround with other compilers), but BCB still doesn't like. Lacking the necessary BCB skills and tools, I'd appreciate if someone can take a look at it and, hopefully, turn it into a valid workaround for Borland. The relevant part is guarded by a "#if defined(__BORLANDC__)" directive.
Hi, the patch makes tupe_test_bench.cpp compile successfully on BCB 5.5.1 and 5.6.4. I have to add the disclaimer that it is an intuitive guess and may not be a real solution. I gave it a try, that's all ;+). The code looked good before I touched it and I have honestly no idea why my adjustments make BCB behave again (for both changes)... That this won't work: typedef typename boost::add_const<typename T::head_type> type; but this typedef typename T::head_type const type; is strange... Is there something wrong with add_const on BCB ?? Regards, Tobias 152a153,161
template<int N, class T> struct element_impl<N, T, true /* IsConst */> { private: typedef typename T::tail_type Next; public: typedef typename element_impl<N-1, Next, true>::type const type; };
162,163c171 < public: < typedef typename boost::add_const<typename T::head_type>::type type; ---
typedef typename T::head_type const type;

Tobias Schwinger wrote:
That this won't work:
typedef typename boost::add_const<typename T::head_type> type;
This is not legal. It should be either: typedef typename boost::add_const<typename T::head_type>::type type; or typedef boost::add_const<typename T::head_type> type; depending on what you are trying to do. -- Eric Niebler Boost Consulting www.boost-consulting.com

Eric Niebler wrote:
Tobias Schwinger wrote:
That this won't work:
typedef typename boost::add_const<typename T::head_type> type;
This is not legal.
Of course. Sorry for any confusion, I just mistyped it. Overthis, there is no such (removed) line in the diff this could refer to. I actually meant: typedef typename boost::add_const<typename T::head_type>::type type; Grabbed it from my editor window, this time - just in case... ;+).
participants (4)
-
Eric Niebler
-
JOAQUIN LOPEZ MU?Z
-
John Maddock
-
Tobias Schwinger