Sujet : Re: constexpr keyword is unnecessary
De : Bonita.Montero (at) *nospam* gmail.com (Bonita Montero)
Groupes : comp.lang.cDate : 19. Oct 2024, 08:18:37
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vevmfj$3p9it$1@raubtier-asyl.eternal-september.org>
References : 1 2
User-Agent : Mozilla Thunderbird
Am 19.10.2024 um 01:54 schrieb Keith Thompson:
The "const" keyword means "read-only"; ...
A global const variable isn't even read-only, i.e. it's value is
assumed to be static and never changed. The compiler never reads
it but uses the constant which is assigned as an immediate value.
I.e. if your platform allows you to change-the value through
casting the updated value is never reflected in the other code.