Boost logo

Boost :

Subject: Re: [boost] [function] bug
From: Edward Diener (eldiener_at_[hidden])
Date: 2009-02-10 16:25:05


Okko Willeboordse wrote:
> Applies for 1.37 and 1.38.
> Using VS2008, SDK 6.1
>
> See ...\function\function_template.hpp
>
> 945 #if !defined(BOOST_NO_EXCEPTIONS)
> 946 try {
> 947 #endif
> 948 if (!f.empty()) {
> 949 this->vtable = f.vtable;
> 950 f.vtable->manager(f.functor, this->functor,
> 951 boost::detail::function::move_functor_tag);
> 952 f.vtable = 0;
> 953 #if !defined(BOOST_NO_EXCEPTIONS)
> 954 } else {
> 955 clear();
> 956 }
> 957 } catch (...) {
> 958 vtable = 0;
> 959 throw;
> 960 }
> 961 #endif
> 962 }
>
> Line
> 953 #if !defined(BOOST_NO_EXCEPTIONS)
> must be moved 3 lines down like;
>
> 945 #if !defined(BOOST_NO_EXCEPTIONS)
> 946 try {
> 947 #endif
> 948 if (!f.empty()) {
> 949 this->vtable = f.vtable;
> 950 f.vtable->manager(f.functor, this->functor,
> 951 boost::detail::function::move_functor_tag);
> 952 f.vtable = 0;
> 953 } else {
> 954 clear();
> 955 }
> 956 #if !defined(BOOST_NO_EXCEPTIONS)
> 957 } catch (...) {
> 958 vtable = 0;
> 959 throw;
> 960 }
> 961 #endif
> 962 }

I can verify that you are correct in that the lines are a bug when
BOOST_NO_EXCEPTIONS is defined. Probably no one has run into this
because no oned uses a compiler with exceptions turned off against the
function library.

Your best bet to have Doug Gregor correct this may be to file a bug
report on it, with a Subversion diff which shows the corrected code in
diff format.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk