Boost logo

Boost :

From: Andrei Alexandrescu (andrewalex_at_[hidden])
Date: 2002-02-07 16:41:58

----- Original Message -----
From: "Kevin Cline" <kcline_at_[hidden]>
> Andrei Alexandrescu writes:
> > > I'm a big fan of having named (or keyword) parameters in the
> >
> > Me too. Unfortunately it's late to introduce named parameters in C++
> > because it's very liberal with the names you give to formal parameters
> > declarations...
> I'm curious why we couldn't use => (or <-) to separate parameter names
> and values.

No, what I meant was what I noticed Peter also said: C++ basically ignores
the formal parameter names:

void f(int a, int b, int c);
void f(int b, int c, in a);
void f(int c, int a, int b);

is a legal program. Now how do you match names to parameters?

> > The only reasonable way now is to come with a keyword to substitute for
> > non-trailing default parameters. The obvious candidate is "default"; I
> > prefer a symbol (such as "?", "!") because "default" is quite a long
> Why can't we just leave the default parameters out?
> f(a,,3)

Bjarne makes an explanation in "Design and Evolution of C++": too easy to
read it the wrong way. I agree with that explanation. So you need to have a
symbol in between the commas.


Check out THE C++ Seminar: 3 Days with 5 Experts

Boost list run by bdawes at, gregod at, cpdaniel at, john at