C++ Logo

std-proposals

Advanced search

Re: Are constrained type barred from std:: implementations?

From: Edward Catmur <ecatmur_at_[hidden]>
Date: Fri, 27 Aug 2021 13:09:49 +0100
On Fri, 27 Aug 2021 at 12:30, Giuseppe D'Angelo via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> On 27/08/2021 13:09, DBJ via Std-Proposals wrote:
> > Thanks, Lenard, I just find it generally peculiar nobody in this
> > honorable forum seem genuinely perturbed
> >
> > This code <https://godbolt.org/z/84TK41c3P>
> >
> > is legal...? Perhaps there is something obvious escaping my cognitive
> > abilities...
>
> That code isn't legal, specifically
>
> #define typename(T_) (#T_)
>
> violates https://eel.is/c++draft/macro.names#2 as typename is a keyword.
> https://eel.is/c++draft/tab:lex.key
>

Ignoring that (as the program seems to be unaffected by its removal), the
program is ill-formed because basic_char_traits<void***> is not specialized
(and cannot be specialized) and so does not meet the character traits
requirements. http://eel.is/c++draft/string.view.template#general-1

Received on 2021-08-27 07:10:12