
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 }

Shouldn't this be accomplished with a destructor? No ifdefs would be needed in that case. Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode On Tue, Feb 10, 2009 at 12:42 PM, Okko Willeboordse <okko.willeboordse@gmail.com> 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 }

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.

Edward Diener <eldiener <at> tropicsoft.com> writes: ...
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 ...
It was not my compiler (VS2008), it was my static code checker. When Exceptions are enabled in VS the compiler defines _CPPUNWIND and then BOOST_NO_EXCEPTIONS is not defined by ...\config\compiler\visualc.hpp. My static code checker wasn't aware of _CPPUNWIND and therefor BOOST_NO_EXCEPTIONS got defined, resulting in lot's of errors. Now when I turn-off exceptions in VS2008 I get more or less the same errors as with the static code tooling. Kind regards, Okko Willeboordse

Edward Diener <eldiener <at> tropicsoft.com> writes:
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.
Bug is already reported (5 times), see; https://svn.boost.org/trac/boost/ticket/2553 https://svn.boost.org/trac/boost/ticket/2499 https://svn.boost.org/trac/boost/ticket/2494 https://svn.boost.org/trac/boost/ticket/2469 https://svn.boost.org/trac/boost/ticket/2466
participants (3)
-
Edward Diener
-
Emil Dotchevski
-
Okko Willeboordse