Xref: utzoo comp.lang.c++:4091 gnu.g++:292 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!columbia!cs!beshers From: beshers@cs.cs.columbia.edu (Clifford Beshers) Newsgroups: comp.lang.c++,gnu.g++ Subject: Re: Default argument values Message-ID: Date: 23 Jul 89 19:21:10 GMT References: Sender: news@cs.columbia.edu Followup-To: comp.lang.c++ Distribution: comp Organization: Columbia University Computer Science Lines: 33 In-reply-to: fox@cs.cs.columbia.edu's message of 23 Jul 89 19:12:17 GMT In article fox@cs.cs.columbia.edu (David Fox) writes: It seems to me that as long as you are going to have default argument values, you might as well allow any combination of arguments to be omitted. I often find myself trying to figure out what order to put the arguments of a function in so that I can give the "right ones" default values. I often fail to find that order: many functions just aren't that "linear". I have fought this problem as well. The way to do this is to allow caller to name the parameters the way Ada does: foo(parm1 = a, parm3 = b, parm2 = c). Is it too late to add this, or something like it, to C++? G++? The problem is that it is already there, but with different semantics: void foo(int parm1, int parm3, int parm2) { ... } ... int parm1, parm2, parm3; foo(parm1 = 1, parm2 = 3, parm3 = 2); What interpretation do you place on this? -- ----------------------------------------------- Cliff Beshers Columbia University Computer Science Department beshers@cs.columbia.edu