Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2002-02-19 14:40:33


----- Original Message -----
From: "vesa_karvonen" <vesa_karvonen_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, February 19, 2002 4:43 AM
Subject: [boost] Re: Most needed/desired features in C++

> --- In boost_at_y..., "Greg Colvin" <gcolvin_at_u...> wrote:
> > And of course, having gotten rid of implicit int, we don't need a
> > keyword at all:
> [...]
> > Or even easier:
> >
> > operator+(t, s) { // type of t and s are implicit
> > v = t+s; // type of v is implicit
> > return v; // return type is implicit
> > }
> > >
>
> Have you considered this legal C++ syntax:
>
> return_type operator+(lhs_type, rhs_type)
> {
> //...
> }

No, but I don't understand what you are doing above.
Please explain.

And to expand on my cryptic suggestion, I am proposing that C++
functions be generic by default, with type names optional, and
needed only when they cannot be deduced. Freedom! Concision!
Long live the Spirit of C!

For a precedent, I think this syntax is not unlike ALGOL's call-
by-name.

For total bliss we can add unnamed functions, e.g.:

    f = (t,s) { return t+s; }

Or much less generically:

    int (*f)(int,int) = (int t,int s) { return t+s; }

And for Nirvana, we can make C++ completely expression oriented,
like ALGOL. Yes, I am getting out on the edge, but I'm serious.

    


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk