C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] Flexible function parameters
From: Magnus Fromreide (magfr_at_[hidden])
Date: 2020-07-09 04:55:48


On Thu, Jul 09, 2020 at 10:32:03AM +0200, Filippo Casarin via Std-Proposals wrote:
> I would like to allow colons and semicolons to appear in function
> parameters

Why?
What is your use case?
What does C++ as a language stand to gain from this change?

The kneejerk reaction to any proposal with no rationale is generally
'Over my dead body' so you really have to make an argument for why the
change should happen.

There is also the time factor, even if your change is agreed upon by
everybody as the best thing ever you won't see it in compilers for
4-6 years so if the change is because you need it NOW then this is the
wrong path.

/MF

> >
> Example:
>
> > void foo(int a, int b; int c);
> > foo(0, 4; 3);
>
>
> void foo(int a=0; int b);
> > foo(/* default vaue for a */ ; 43);
> >
>
>
> > template <class... Args1; class... Args2>
>
> void foo(Args1&&... args1; Args2&&... args2);
> >
>
> I would also like this to extend this to the operator[]
>
> Example:
>
> > template <class T>
> > struct matrix {
> > T &operator[](size_t i, size_t j);
> > };
> >
>
>
> > template <class T, size_t N>
> > struct array {
> > std::span<T> operator[](size_t i : size_t j);
> > };
> >

> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals


STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups