Thread View: comp.std.c++
1 messages
1 total messages
Started by Bob Kline
Sat, 18 Nov 1995 03:16
overload resolution question
Author: 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. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads