Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-10-07 21:48:48

Thanks to some insight from Brad King, I've introduced additional syntax into
Boost.Function that makes function<..> instances act more like function
pointers. Assignment to and comparison with zero is now supported, e.g.:

  function<int (int x, int y)> f;
  f = std::plus<int>();
  assert(f != 0); // same as assert(!f.empty())
  f = 0; // same as f.clear()
  assert(0 == f); // same as assert(f.empty());
This change is source-compatible but not necessarily binary-compatible with
older versions on Boost.Function. Nonetheless, it was only made on the CVS
trunk (not the branch), and will appear in 1.30.0.

With this change I would also like to deprecate the use of the empty() and
clear() members for removal in a future version of Boost.Function. The
'compatible'/'broken'/'portable'/'whatever' syntax will retain the empty()
and clear() methods (most compilers that need the functionN classes can't
handle the tricks required to get the above to compile), but the
boost::function class template itself will only support the lean function
pointer-like interface. Opinions on this?

Documentation forthcoming...


Boost list run by bdawes at, gregod at, cpdaniel at, john at