Boost logo

Boost Users :

From: Peter Soetens (peter.soetens_at_[hidden])
Date: 2007-11-13 10:54:15


Hi,

Upto boost 1.33.x, I could compile my program with the gcc
option -fno-exceptions. Since boost 1.34.0, this is no longer possible due to
code changes in operator= in boost/function/function_template.hpp
The following snippets fail to compile:

Line 561-571:
    operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
    {
      this->clear();
      try {
        this->assign_to(f);
      } catch (...) {
        vtable = 0;
        throw;
      }
      return *this;
    }

and lines 589-602:
    // Assignment from another BOOST_FUNCTION_FUNCTION
    BOOST_FUNCTION_FUNCTION& operator=(const BOOST_FUNCTION_FUNCTION& f)
    {
      if (&f == this)
        return *this;

      this->clear();
      try {
        this->assign_to_own(f);
      } catch (...) {
        vtable = 0;
        throw;
      }
      return *this;
    }

The 1.33.0 and older versions used swap() instead of this try / catch / throw
construct. These versions also used the boost::throw_exception function
instead of a plain throw.

Any rationale for this decision ? Should some/all boost functions compile
exception free as well ? I'm using -fno-exceptions on embedded systems.

Peter

-- 
Peter Soetens -- FMTC -- <http://www.fmtc.be>

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