Topic: Changes in <functional> in Oct 97 DWP ?
Author: Ralf Stoffels <stoffels@faho.rwth-aachen.de>
Date: 1997/11/04 Raw View
> There are some problems with type qualifiers and reference / non-
> reference types in <function> (Dec 96 DWP).
>
> Kevin S. Van Horn proposed his <xfunctional.h> to fix this problems.
> http://www.xmission.com/~ksvhsoft/code/fct_objs.html
Perhaps these problems are not as known as I thought.
Example:
bool f(const A& a, const A& b)
{return true;}
bool b = bind2nd(ptr_fun(f), a2)) (a1);
According to the Dec 96 DWP this is illegal, because
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>& x,
const const A&&); // :-(
and the
bool operator () (const const A &&) const; // :-(
This is not a simple bug in the DWP, it requires a redesign like the
<xfunctional.h> of Kevin S. Van Horn. In many templates you need to know
the plain type of the template arguments (without any qualifiers and &'s).
> Are there any improvements for this in the Oct 97 DWP ?
Ralf
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: Ralf Stoffels <stoffels@faho.rwth-aachen.de>
Date: 1997/10/29 Raw View
There are some problems with type qualifiers and reference / non-
reference types in <function> (Dec 96 DWP).
Kevin S. Van Horn proposed his <xfunctional.h> to fix this problems.
http://www.xmission.com/~ksvhsoft/code/fct_objs.html
Are there any improvements for this in the Oct 97 DWP ?
BTW, what are the major changes in the Oct 97 DWP ?
Ralf
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]