Topic: name lookup with operator new
Author: MikeAlpha@NoSpam_csi.com (Martin Aupperle)
Date: Sat, 11 Aug 2001 23:07:25 GMT Raw View
Hello,
In CUJ March 2001 (p 67 ff), Herb Sutter talks about overloading of
new and delete for our own classes. On p 69, he writes:
"Remember, how name lookup works ... [snip]".
In short, he is saying that the search begins in the actual scope and
continues outward to the scope where the name is eventually found. All
names in that scope overload, no other scopes are considered.
This looks to me like the standard name lookup algorithm for
functions. But 13.3.1.2. [over.match.oper] says that lookup rules for
operators work differently - if I understood the Standard right, which
is not guaranteed, of course.
Who is right?
Martin
------------------------------------------------
Martin Aupperle
MikeAlpha@NoSpam_csi.com
(remove NoSpam_)
------------------------------------------------
---
[ 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.research.att.com/~austern/csc/faq.html ]
Author: MikeAlpha@NoSpam_csi.com (Martin Aupperle)
Date: Thu, 2 Aug 2001 15:53:52 GMT Raw View
Hello,
In CUJ March 2001 (p 67 ff), Herb Sutter talks about overloading of
new and delete for our own classes. On p 69, he writes:
"Remember, how name lookup works ... [snip]".
In short, he is saying that the search begins in the actual scope and
continues outward to the scope where the name is eventually found. All
names in that scope overload, no other scopes are considered.
This looks to me like the standard name lookup algorithm for
functions. But 13.3.1.2. [over.match.oper] says that lookup rules for
operators work differently - if I understood the Standard right, which
is not guaranteed, of course.
Who is right?
Martin
------------------------------------------------
Martin Aupperle
MikeAlpha@NoSpam_csi.com
(remove NoSpam_)
------------------------------------------------
---
[ 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.research.att.com/~austern/csc/faq.html ]