Arne Mertz writes about modern C++ practices, including idioms, static analysis, ranges, and code quality.
HN links his April Fools post "Raw Pointers Are Gone", which readers struggled to tell from a real article, and his posts on C++ idioms.
> All of this means that const actually provides zero guarantees about an object not being mutated (and even in the case where the object is directly constructed as const, that just means that it's undefined behavior when the object is mutated, not that the compiler actually protects against it being mutated).
if this is the only reason why author thinks that const is a problem, then it is all good. you can do the same thing in C as well. and ofcourse, if you do that, and break things, you get to hold all the pieces as well :)
probably a 'constexpr' semantics is what the author might be looking for ?
arne-mertz article on mutable, available here: https://arne-mertz.de/2017/10/mutable/, which imho, is another side of the const-coin, is quite good as well.
edit-001 : slight change.
Having started using the Internet in the 90's, and thus still remembering Geocities-era websites, I loved that they did this as a webring (https://en.wikipedia.org/wiki/Webring): each blog post has a link to the next one, making a singly-linked circular list.
Starting with this one, we have:
- http://www.bfilipek.com/2018/04/deprecating-pointers.html
- http://www.modernescpp.com/index.php/no-new-new
- https://www.fluentcpp.com/2018/04/01/cpp-will-no-longer-have-pointers/
- https://blog.tartanllama.xyz/no-pointers/
- https://arne-mertz.de/2018/04/raw-pointers-are-gone/
And it circles back to this one.
One of my favourite april fool's jokes in tech: https://arne-mertz.de/2018/04/raw-pointers-are-gone/
It actually made it to the HN front page and people had a hard time deciding whether this was a joke or not: https://news.ycombinator.com/item?id=16727441
How is this different from the (relatively common afaik) passkey idiom https://arne-mertz.de/2016/10/passkey-idiom/ ?
These are just examples to make a point.
And: https://arne-mertz.de/2016/12/modern-c-features-attributes/
This reminds me of the Passkey idiom: https://arne-mertz.de/2016/10/passkey-idiom/