From: Nicola Musatti (Nicola.Musatti_at_[hidden])
Date: 2007-03-26 09:33:52


Hallo,
unfortunately the recently committed changes to Boost.Optional uncover a bug in
BCB6, i.e. borland 5.6.4 . As 1.34 is going to be the last Boost release to
officially support this compiler, it would be very important to fix this problem
before the release.

I see that currently no tester is running tests for borland 5.6.4; if none is
available I could run the tests locally on my machine and report back or, with a
little hand-holding, run a full regression run.

The bug can be observed by compiling the following very simple source file:

#include <boost/optional.hpp>
#include <sstream>

This result in a rather incomprehensible error message:
[C++ Error] _ctype.h(124): E2034 Cannot convert 'int *' to
'const ctype_base::mask *'

The problem appears to be triggered by the relational operator overloads that
take a none_t as a first argument (don't ask me why!). By commenting out lines
838-866 in boost/optional/optional.hpp the problem disappears.

The only workaround I was able to find is to revert to the previous
implementation of boost/none.hpp, as in the following:

#include <boost/detail/workaround.hpp>

namespace boost {

#if ! BOOST_WORKAROUND(__BORLANDC__, <= 0x564)

namespace detail { struct none_helper{}; }

typedef int detail::none_helper::*none_t ;

none_t const none = ((none_t)0) ;

#else

enum none_t {none = 0};

#endif

} // namespace boost

Given this is such a simple header it may be reasonable not to include
boost/detail/workaround.hpp here and explicitly state the condition. Note that
this problem is not present in borland 5.8.2.

Cheers,
Nicola Musatti