Boost logo

Boost Users :

From: david_at_2good (david_at_[hidden])
Date: 2002-08-14 08:47:02


I am using the free C++Builder Compiler version 5.5.1 for Win32.
(http://www.borland.com/products/downloads/download_cbuilder.html)

I have used Boost 1.27 without problems, but when compiling the same
code with Boost 1.28 I get this error message for the compiler:

Error E2113 c:\borland\boost_1_28_0\boost/detail/shared_count.hpp 39:
Virtual function 'use_count_is_zero::what() const throw()' conflicts
with base class 'exception'

The class use_count_is_zero (new in Boost 1.28) inherits from
std::exception, and it seems like the method prototype for what() is
different in the Borland include files and Boost.

Boost:

class use_count_is_zero: public std::exception
{
public:

    virtual char const * what() const throw()
    {
        return "use_count_is_zero";
    }
};

Borland, who seem to use STL from Rogue Wave Software:

  class _RWSTDExport exception
  {
  public:
    exception () _RWSTD_THROW_SPEC_NULL
    { ; }
    exception (const exception&) _RWSTD_THROW_SPEC_NULL
    { ; }
#if defined(_MSC_VER) && !defined(__BORLANDC__)
    exception (const char *s) _RWSTD_THROW_SPEC_NULL
    { ; }
#endif
    exception& operator= (const exception& e) _RWSTD_THROW_SPEC_NULL
    { return *this; }
    virtual ~exception () _RWSTD_THROW_SPEC_NULL;

    virtual const char * what () const _RWSTD_THROW_SPEC_NULL
    {
      return __RWSTD::__rw_stdexcept_NoNamedException;
    }
  };

The content of _RWSTD_THROW_SPEC_NULL is set in the file stdcomp.h,
and it seems like it is empty for the Borland compiler, so I tried to
copy the declaration from Borland like below, but got the same error.

class use_count_is_zero: public std::exception
{
public:

    virtual const char * what () const _RWSTD_THROW_SPEC_NULL
    {
        return "use_count_is_zero";
    }
};

Any suggestions?

\David


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net