Topic: tempate new syntax [was: Evolution of C++ : Thinking ahead of what's to come]


Author: nesotto@cs.auc.dk ("Thorsten Ottosen")
Date: Sun, 12 Sep 2004 16:51:09 GMT
Raw View
"Steven T. Hatton" <hattons@globalsymmetry.com> wrote in message
news:ZpGdnXIM18P03t_cRVn-hA@speakeasy.net...
|
| Thorsten Ottosen wrote:
|
|  > If the only reason is faster parsing speed, then I don't see why one
|  > should change anything. Time
|  > is working to our advantage...the next time I buy a lap-top it will be 4
|  > times as fast; even for many years
|  > good compilers with pre-compiled  headers have been quite fast at
|  > compiling stuff.
|
|
| What about parsing/compiling portable code on the fly in situations where
| you want virtually immediate results?  I don't believe that is beyond the
| realm of foreseeable requirements.

yeah, It's always nice with faster builds, but the confusion that two
different syntaxes
can bring is also worth considering.

Another template syntax will probably hurt portability.

For programs with heavy use of templates, I vaguely recall that Daveed V. said
that
something like his metacode would improve compilation speed. By how much I
don't know.

br

Thorsten


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: lothar@xcerla.com (Lothar Werzinger)
Date: Mon, 13 Sep 2004 03:39:09 GMT
Raw View

Re: tempate new syntax [was: Re: Evolution of C++ : Thinking ahead of what's
to come]
From:
Lothar Werzinger <lothar@xcerla.com>
Date:
Sunday 12 September 2004 10:57:32
Groups:
comp.std.c++,comp.lang.c++.moderated
Followup-To:
comp.std.c++
no references

Andrei Alexandrescu (See Website for Email) wrote:

> On an unrelated vein, I use "!" for passing-in default arguments to
> function, and people say it looks great:
>
> void Foo(int = 0, string = "wyda", double = 0);
>
> can be called:
>
> Foo(2, !, 1); // calls Foo(2, "wyda", 1);
>
>
> Andrei

When it comes to default arguments I would muh more like the Python way by
naming the variables. With that you can specify them in any order and omit
all that you do not want to use. Of course that would REQUIRE to have names
in the declaration of methods/functions with default parameters.

void Foo(int number = 0, string text = "wyda", double amount = 0);

can be called:

// calls Foo(0, "hello andrei", 3.14);
Foo(amount = 3.14, text = "hello andrei");

Lothar

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]





Author: francis@robinton.demon.co.uk (Francis Glassborow)
Date: Mon, 13 Sep 2004 10:29:51 GMT
Raw View
In article <20040912140835.GA5789@mail19g.g19.rapidsite.net>, Lothar
Werzinger <lothar@xcerla.com> writes
>When it comes to default arguments I would muh more like the Python way by
>naming the variables. With that you can specify them in any order and omit
>all that you do not want to use. Of course that would REQUIRE to have names
>in the declaration of methods/functions with default parameters.

It would also require that those names have some form of extended scope,
and that is a little less trivial.


--
Francis Glassborow      ACCU
Author of 'You Can Do It!' see http://www.spellen.org/youcandoit
For project ideas and contributions: http://www.spellen.org/youcandoit/projects

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]