> <
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0745r0.pdf> proposal, and
> at "5.4" appear the interesting "foo(Even int i)", from P0791
> <
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0791r0.pdf>
>
> Instead of pushing contracts, the same syntax may be used for
> disambiguation in "same type" x "different types"
>
>
> |
> foo(EqualyComparablee1,EqualyComparablee2); //e1 and e2 may have (by
> default) different types ? ( I´m open to discuss )
> foo(EqualyComparableT e1,EqualyComparableT e2); //e1 and e2 must
> have same type, and it´s called "T"
> foo(EqualyComparableT1 e1,EqualyComparableT2 e2); //e1 and e2
> definitely may have different types, "T1" and "T2" respectively
>
> |
>
>
> Somebody already thought about that ?
>
>
> Some discussed (but perhaps not in any paper) variants of the adjective
> syntax would allow this:
>
> auto foo(EqualityComparable auto a, EqualityComparable auto b) // a and
> b can have different types
> auto foo(EqualityComparable typename T1 a, EqualityComparable typename
> T2 b) // verbose but equivalent to the previous declaration
>
> auto foo(EqualityComparable typename T a, T b) // a and b have the same type
> auto foo(EqualityComparable typename T a, EqualityComparable T b) //
> redundant but equivalent to the previous declaration
How would this work for variadic templates?
I assume:
auto foo(EqualityComparable auto... as) // as can have different types
auto foo(EqualityComparable typename T... as) // as have the same type