This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Test standard function names?
- From: Jack Lloyd <lloyd at acm dot jhu dot edu>
- To: Kevin Handy <kth at srv dot net>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Mon, 16 Sep 2002 20:08:27 -0400 (EDT)
- Subject: Re: Test standard function names?
- Organization: JHU ACM/CS/SRL
On Mon, 16 Sep 2002, Kevin Handy wrote:
> I was thinking C mostly. C++, maybe, but with it's polymorphic
> functions would make things a lot harder.
There are other problems with C++. First, I can define something named min
or ifstream or cout or whatever, as long as I do it inside something other
than std:: (or the global namespace, if "using namespace std" is in
effect). I really don't know the exact language rules about this, you may
well be able to define something named ifstream even if you're also using
the std:: namespace.
Also, sometimes it's perfectly legitimate and useful to do something like
specialize a C++ template function inside a namespace std block. For
example providing an optimized version of std::swap for an object that
you've created.
-Jack