On Thu, Apr 27, 2023 at 11:08 AM Daniel Krügler via Std-Discussion <std-discussion@lists.isocpp.org> wrote:
Am Do., 27. Apr. 2023 um 17:05 Uhr schrieb Thiago Macieira via
Std-Discussion <std-discussion@lists.isocpp.org>:
> Is this intended with C++20's class-type NTTPs?




But this doesn't really answer the OP's question. Consider that we can simply do this:

template <class T> struct Structural {};

template <auto Call = Structural<decltype([]{})>{}> struct S {};
Now the template parameter type is structural, but there is still a question of whether the lambda type is the same every time `S<>` is referenced.

> template <auto Call = []{}> struct S {};
> static_assert(!std::is_same_v<S<>, S<>>);
> It passes the compilation in the three major compilers that have implemented
> the feature in the first place:
> https://conformance.godbolt.org/z/edf8Pv71j
> I'm not asking to change this. I actually want it this way. But I'd like a
> confirmation that this is the intention and won't suddenly break my code later.

It is not intended and it is likely that compilers will adjust to make
that ill-formed.

- Daniel
Std-Discussion mailing list

Brian Bi