Topic: Defect Report: unary_function and binary_function should


Author: petebecker@acm.org (Pete Becker)
Date: Thu, 19 Aug 2004 18:43:10 GMT
Raw View
Joe Gottman wrote:
>
> [ note: forwarded to C++ Comittee - sdc ]
>
>    The classes std::unary_function and std::binary_function are both
> designed to be inherited from but contain no virtual functions.  This makes
> it too easy for a novice programmer to write code like
>     binary_function<int, int, int> *p = new plus<int>;
>     delete p;
>

Anyone who does this will quickly discover that there's nothing useful
that they can do with p, so they won't do it in the future. There's no
real problem here, and no need to make any changes.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)

---
[ 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    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]