Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-05-23 09:12:29


Ben Hutchings wrote:
> Walter Fettich wrote:
>> Hello
>>
>> I'm having a problem when using shared pointers in Embedded Visual
>> C++ .Net STLPort.
>>
>> When trying to compile I always get the error
>> 'bad_alloc' : is not a member of 'stlp_std'
>> in the file boost/detail/shared_count.hpp
>>
>> Do you know of any solution or what I can do to fix it?
>
> STLport works very poorly on WinCE. I have done some work to
> integrate it with the WinCE 4 (aka WinCE .NET) C++ library but have
> not yet completed that.
>
> I can tell you you will probably need to change the line:
> # ifndef _STLP_WINCE
> in stlport/new.h to be:
> # if !defined(_STLP_WINCE) || _WIN32_WCE+0 >= 400
>
>> The macro BOOST_NO_EXCEPTIONS is defined.
>
> Oh, in that case never mind the above.
>
>> Is it a problem in STLPort or Boost?
> <snip>
>
> It is a problem with your configuration. Exceptions are a standard
> C++ feature and many Boost libraries require them. You could probably
> change shared_ptr to work without them, but the alternative would be
> to abort() the program and that's probably not satisfactory.

shared_ptr supports BOOST_NO_EXCEPTIONS via <boost/throw_exception.hpp>, but
the problem here is that it expects <new> to define std::bad_alloc, and this
apparently doesn't happen in the WinCE+STLPort configuration for some
reason. Your fix above may still help.

http://boost.org/libs/utility/throw_exception.html


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