Boost logo

Boost :

From: Ralf Stoffels (stoffels_at_[hidden])
Date: 1999-02-11 14:31:14

I see a problem in the standard-library-header <funtional>.
(I hope this is the right mailing-list to discuss such problems.)

You cannot handle functional objects with bind... which use reference

Here is simple example:

  struct A {}
  a1, a2;

  bool f(const A& a, const A& b)
  {return true;}
  bool b = std::bind2nd(std::ptr_fun(&f), a2) (a1); // reference to
reference error

Problem description:
  ptr_fun returns a pointer_to_binary_function<const A&, const A&,
bool> // ok

  bind2nd returns a
  binder2nd<pointer_to_binary_function<const A&, const A&, bool> >
  with the ctor:
  binder2nd (const pointer_to_binary_function<const A&, const A&, bool>&
             const const A&&); // :-(
  and the
  bool operator () (const const A &&) const; // :-(

Kevin S. Van Horn has a solution for those problems:


eGroup home:
Free Web-based e-mail groups by

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