Re:Proposal to add constexpr to C [pdf]
by voldacar on Saturday October 16, 2021 @08:11AM
(#28887297)
"Constexpr" is possibly the most hideous keyword in any programming language. My eyes vomit a little each time I read it.
They could have just used "pure" like in D, but this is C++, so that would be too sane and obvious.
Introducing a new keyword means that all existing code that uses the new keyword as an identifier will break. That's why the `constexpr` keyword is deliberately weird.
It's also why they reuse keywords like `using`.
Re:Proposal to add constexpr to C [pdf]
by kevin_thibedeau on Saturday October 16, 2021 @02:50PM
(#28890348)
They could just use the reserved keyword naming like the C committee does.
Politics, check the outcome of the networking vote.
Re:Proposal to add constexpr to C [pdf]
by dataflow on Saturday October 16, 2021 @10:58AM
(#28888296)
No, not all const is superfluous. You don't want const-able method to be const. And const is a property of the declaration, not the definition. But constexpr is superfluous. It's something the compiler can infer purely from looking at the definition, and it has little to no "design" value like const does.
Re:Proposal to add constexpr to C [pdf]
by dataflow on Saturday October 16, 2021 @03:27PM
(#28890685)
> You don't want const-able method to be const.
Edit, typo: I meant "You don't want every const-able method to be const."
I can't confirm in this specific case but, more often than not, the reason for these redundancies is a fraction of the committee felt uncomfortable with the implicit solution, so the keyword got added.
There is a video about the story background, where a group of kids play the role of the committee voting down Circle.
Link?
https://www.circle-lang.org/
Unfortunately, there is a big political war ongoing, so instead C++ keeps collecting const.... keywords.