C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Type modifier to disable integer promotion

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 1 Apr 2025 17:12:45 +0200
Also is auto z1 = i + u; auto z2 = u + i; the same type? -----Ursprüngliche Nachricht----- Von:Howard Hinnant via Std-Proposals <std-proposals_at_[hidden]> Assume char is 8 bit, short is 16 bit, int is 32 bit signed char i{}; unsigned char u{}; auto z = i + u; Possibilities: compile-time error run-time error z is signed char z is unsigned char z is short z is unsigned short z is int z is unsigned int What is your recommendation? Howard

Received on 2025-04-01 15:18:31