C++ Logo

std-discussion

Advanced search

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

From: Daniel Krügler <daniel.kruegler_at_[hidden]>
Date: Mon, 10 Aug 2020 16:27:31 +0200
Am Mo., 10. Aug. 2020 um 15:48 Uhr schrieb Matthew Woehlke via
Std-Discussion <std-discussion_at_[hidden]>:
>
> 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?

Typically some embedded system compilers. In our company we use such
compilers with CHAR_BITS = 32.

- Daniel

Received on 2020-08-10 09:31:06