Topic: Cannot take p-to-SL func portably, parts of SL not compatible


Author: kprateek88@yahoo.com (Prateek R Karandikar)
Date: Sat, 26 Jun 2004 07:03:53 +0000 (UTC)
Raw View
The Guru of the Week #64 (http://www.gotw.ca/gotw/064.htm) explains
that the Standard allows implementations to add additional default
parameters to SL functions. So the Standard does not specify the types
of the SL functions completely, and thus we cannot portably take a
pointer-to-function of an SL function!

>From the GotW #64:

<quote>
"Do you think it's a little odd that you can portably use a standard
library facility, namely mem_fun, with everything except the standard
library itself? Do you think it's odd that you can portably use a
language feature, namely a pointer to member function, with everything
except the language's own standard library?"
</quote>

My answer is a strong yes to both the questions. Why does the Standard
allow these additional parameters? They can anyway be used only as
extensions and not in a Standard-guaranteed way. If the Standard did
not allow this and an implementation is still desperate to provide the
extension, it can always be provided as a separate, differently-named
function.

--                                    --
Abstraction is selective ignorance.
-Andrew Koenig
--                                    --

---
[ 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                       ]