Article View: comp.std.c++
Article #2619overload resolution question
From: Bob Kline
Date: Sat, 18 Nov 1995 03:16
Date: Sat, 18 Nov 1995 03:16
33 lines
2019 bytes
2019 bytes
We notice that the ARM has the following language: "Since for any type T, a T and a T& accept the same set of initializer values, functions with argument types differing only in this respect may not have the same. .... Similarly, since for any type T, a T, a const T, and a volatile T accept the same set of initializer values, functions with argument types differing only in this respect may not have the same name." However, we are unable to find the equivalent language in the latest draft. Is this intentional? Is the following call of f() ambiguous? void f(const A&); void f(const A); .... A a; f(a); We get different results from different compilers. One rejects the call as ambiguous, and the other resolves the call to the second version. Is the answer any different if the second version of f() is declared 'void f(A);' (without const in front of A)? -- /*----------------------------------------------------------------------*/ /* Bob Kline Stream International */ /* bob_kline@stream.com formerly Corporate Software, Inc. */ /* voice: (703) 522-0820 x-311 fax: (703) 522-5407 */ /*----------------------------------------------------------------------*/ --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<48ipec$9vk@lhc.nlm.nih.gov>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 18 Nov 95 03:16:35 GMT Approved: fjh@cs.mu.oz.au From: bkline@cortex.nlm.nih.gov (Bob Kline) Newsgroups: comp.std.c++ Subject: overload resolution question X-Original-Date: 17 Nov 1995 19:57:00 GMT Organization: National Library of Medicine Message-ID: <48ipec$9vk@lhc.nlm.nih.gov> X-Newsreader: TIN [version 1.2 PL2] X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMK1QI+EDnX0m9pzZAQEsKgF/dAhQjU6ueKfPIibPqB9Zy88qzOpuG3sN 8aiyCDjq4RLiBls4SOF4ohWWpcs9OWaS =Lyw6