C++ Logo

std-proposals

Advanced search

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

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Sun, 30 Mar 2025 18:33:00 +0200
Possible, but unlikely.   What was first flexibility, turns into rigid convention.   short 16 int 32 long 64 long long 128   seems more likely (if possible by the rules)   -----Ursprüngliche Nachricht----- Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> Gesendet:So 30.03.2025 18:22 Betreff:Re: [std-proposals] Type modifier to disable integer promotion An:std-proposals_at_[hidden]; CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>; Jonathan wrote: > This certainly looks like it's checking for promotion: > > std::is_same< uint_fast32_t, decltype(uint_fast32_t() + > > uint_fast32_t()) > Yeah that's exactly what I meant. Jonathan also wrote: >> So anyway my code looks a little ridiculous in places >> as I'm super-paranoid about stuff such as a 32-Bit >> unsigned int promoting to a 64-Bit signed int. > > As discussed, there are no platforms in existence where that can happen, > and that's unlikely to change. You're saying there will never be a computer with a 64-Bit int? Because on such a computer, a 32-Bit integer type (for instance 'short unsigned') would promoted to a 64-Bit int. Maybe in a decade or two we'll have computers as follows: char - 8 short - 32 int - 64 long - 128 long long - 128 -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-03-30 16:38:44