Sujet : Re: C23 thoughts and opinions - why so conservative?
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 24. May 2024, 02:35:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86ikz4htz5.fsf@linuxsc.com>
References : 1 2 3 4
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Michael S <
already5chosen@yahoo.com> writes:
[what new language features would you like?]
Ability to break from nested loops. Ability to"continue" outer
loops would be nice too, but less important. [...]
>
1. global objects, declared in header files and included
several times. Where defined? [...] I wnat it to "just work"
everywhere. [...]
Both of these features seem like frills. Neither one is either
necessary or common; they would make the language bigger but
especially any better. Adding them would be the proverbial tail
wagging the dog.
2. Reversing defaults for visibility of objects and functions
at file scope.
Something like:
#pragma export_by_default(off).
Not sure taking a half-and-half approach on this is a good idea,
but if so I think it's better to have the choice be a per-TU
compilation option rather than a #pragma.
When this pragma is in effect, we need a way to make objects and
functions globally visible. I think that it's done best with new
storage class.
Just use extern. No new storage class needed.
With regard to constexpr, mentioned above by James Kuyper, my
feeling about it is that it belongs to metaprogramming so I
would not consider it a real storage class.
Having 'constexpr' be classified as a storage class illustrates
how poorly thought out it is.