From -5678429392931678695 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,ae69797e9d0a9303 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2001-06-18 00:21:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!212.74.64.35!colt.net!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: Martin von Loewis Newsgroups: comp.std.c++ Subject: Re: Koenig lookup and classes/constructors Date: Mon, 18 Jun 2001 07:20:12 GMT Organization: Humboldt University Berlin, Department of Computer Science Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: References: X-Trace: mail2news.demon.co.uk 992848820 mail2news:15106 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) NNTP-Posting-Date: 17 Jun 2001 20:59:18 GMT X-Newsreader: Gnus v5.7/Emacs 20.7 Lines: 31 Xref: archiver1.google.com comp.std.c++:6170 celtschk@web.de ("Christopher Eltschka") writes: > Are classes/"constructor calls" are looked up via Koenig lookup? No. 3.4.2 specifies that only postfix expressions in function calls, as explained in 5.2.2, are subject to argument-dependent lookup, i.e. the result of the lookup must be an expression, or a function name. If your code was well-formed, you'd have an explicit type conversion as explained in 5.2.3, where you'd need a simple-type-specifier before the parentheses. Type specifiers are never found by Koenig lookup. > Therefore it _does_ find X::B, but doesn't consider the constructor a > match. Changing B(A) to B(A&) doesn't change this. Is this correct > behaviour? I think so (not surprisingly :-) Interestingly enough, Sun CC 5.2 reports "a.cc", line 16: Error: Unexpected type name "X::B" encountered. so it also finds X::B ... Regards, Martin --- [ 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 ]