C++ Logo

std-discussion

Advanced search

CNTTP defaulted to lambda in definition produces different type every time

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 27 Apr 2023 08:05:09 -0700
Is this intended with C++20's class-type NTTPs?

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.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2023-04-27 15:05:11