Xref: utzoo comp.lang.c++:11388 comp.std.c++:557 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uunet!brunix!sdm From: sdm@cs.brown.edu (Scott Meyers) Newsgroups: comp.lang.c++,comp.std.c++ Subject: overloading resolution and const Message-ID: <63156@brunix.UUCP> Date: 31 Jan 91 17:42:39 GMT Sender: news@brunix.UUCP Reply-To: sdm@cs.brown.edu (Scott Meyers) Organization: Brown University Department of Computer Science Lines: 33 In the ARM description of conversion sequences for matching actual parameters to formals during resolution of calls to overloaded functions, it says the first thing tried is: [1] Exact match: Sequences of zero or more trivial conversions are better than all other sequences. Of these, those that do not convert T* to const T*, T* to volatile T*, T& to const T&, or T& to volatile T& are better than those that do. (ARM, p. 318.) How does the fact that not converting to const or volatile is "better" enter into things? That is, under what conditions would this part of rule [1] determine which function should be called? The single-parameter case doesn't seem to lend any insight, since no compiler I have access to will accept the following two functions in the same scope: void f(double) {} void f(const double) {} I tried concocting a two-parameter example that would lend some insight, but I was unable to do so (especially after I got different behavior from g++, cfront 2.0, and cfront 2.1 on one example). Can anyone help clarify the purpose of the above statement that lack of conversion to const/volatile within an exact match is better? Thanks, Scott ------------------------------------------------------------------------------- What do you say to a convicted felon in Providence? "Hello, Mr. Mayor."