C++ Logo

STD-PROPOSALS

Advanced search

Subject: [std-proposals] Flexible function parameters
From: Filippo Casarin (casarin.filippo17_at_[hidden])
Date: 2020-07-09 03:32:03


I would like to allow colons and semicolons to appear in function
parameters

>
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 list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups