Deutsch English Français Italiano |
<vf0ijd$3u54q$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Thiago Adams <thiago.adams@gmail.com> Newsgroups: comp.lang.c Subject: Re: constexpr keyword is unnecessary Date: Sat, 19 Oct 2024 12:18:04 -0300 Organization: A noiseless patient Spider Lines: 25 Message-ID: <vf0ijd$3u54q$1@dont-email.me> References: <veb5fi$3ll7j$1@dont-email.me> <877ca5q84u.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 19 Oct 2024 17:18:06 +0200 (CEST) Injection-Info: dont-email.me; posting-host="08acdff8dec93de51a377425374e1364"; logging-data="4134042"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7DhMOB6zuVTUg8eVBquwvUQVrkHmtK5o=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:qQCaDK4GDAFE3Eav0rfjYhSeWKg= Content-Language: en-GB In-Reply-To: <877ca5q84u.fsf@nosuchdomain.example.com> Bytes: 1681 Em 10/18/2024 8:54 PM, Keith Thompson escreveu: > Thiago Adams <thiago.adams@gmail.com> writes: >> I think constexpr keyword is unnecessary. > > Sure, most language features are strictly unnecessary. > >> Anything you do with it could/should be done with const. > > No, absolutely not. > If not, do you have a sample where, using "const" as "constexpr", would create problems? The sample I know is VLA. const int c = 2; int a[c]; //a is VLA because c is not a constant expression. But this is not enough to convince me because it is better not to be a VLA here.