Date: Fri, 28 Feb 2025 14:49:18 +0100
pt., 28 lut 2025 o 13:30 Bengt Gustafsson via Std-Proposals
<std-proposals_at_[hidden]> napisaĆ(a):
>
> My proposal P3312 tries to address this type of issues.
>
> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3312r0.pdf
>
I do not think this `decltype` usage is correct as "type of function"
should not contains
specific function itself (even if this overload set):
```
void f();
void h();
decltype(f) ==decltype(h)
void foo(int);
void foo();
void bar(int);
void bar();
decltype(foo) !=decltype(bar)
```
I think better would be some "lambda converter" operations that work
with single functions and overload sets, some suggest `[]foo` as one
possibility.
Then `decltype` would work better:
```
void f();
void h();
decltype(f) ==decltype(h)
decltype([]f) !=decltype([]h)
void foo(int);
void foo();
void bar(int);
void bar();
decltype(foo) ==decltype(bar) //if we want allow this usage anyway
decltype([]foo) !=decltype([]bar)
```
>
> --
> Bengt Gustafsson
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
<std-proposals_at_[hidden]> napisaĆ(a):
>
> My proposal P3312 tries to address this type of issues.
>
> https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3312r0.pdf
>
I do not think this `decltype` usage is correct as "type of function"
should not contains
specific function itself (even if this overload set):
```
void f();
void h();
decltype(f) ==decltype(h)
void foo(int);
void foo();
void bar(int);
void bar();
decltype(foo) !=decltype(bar)
```
I think better would be some "lambda converter" operations that work
with single functions and overload sets, some suggest `[]foo` as one
possibility.
Then `decltype` would work better:
```
void f();
void h();
decltype(f) ==decltype(h)
decltype([]f) !=decltype([]h)
void foo(int);
void foo();
void bar(int);
void bar();
decltype(foo) ==decltype(bar) //if we want allow this usage anyway
decltype([]foo) !=decltype([]bar)
```
>
> --
> Bengt Gustafsson
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-02-28 13:49:33