C++ Logo

std-discussion

Advanced search

Re: What makes bool{2} ill-formed?

From: Matthew Woehlke <mwoehlke.floss_at_[hidden]>
Date: Mon, 10 Aug 2020 09:48:13 -0400
On 07/08/2020 11.36, Lyberta via Std-Discussion wrote:
> Matthew Woehlke via Std-Discussion:
>> `bool{2}` is invalid (narrowing) for the same reason `char{65536}` is invalid.
>
> char{65536} is implementation-defined.

Well, if you take off your pedant's hat, I clearly meant
char{literal_value_outside_of_char's_range}.

That said, what implementations have CHAR_BITS > 16?

-- 
Matthew

Received on 2020-08-10 08:51:39