Re:C constructs that still don't work in C++
by spacechild1 on Monday May 25, 2026 @07:53AM
(#48265789)
What's the "sequence point operator"?
Re:C constructs that still don't work in C++
by twoodfin on Monday May 25, 2026 @09:56AM
(#48266900)
,
Re:C constructs that still don't work in C++
by spacechild1 on Monday May 25, 2026 @11:32AM
(#48268047)
That's the comma operator. I didn't know you could overload it! That's pretty crazy. However, I have never seen anyone do that. Do you have any real world examples?
See e.g. the very-popular Eigen library, in which the type CommaInitializer basically exists for the sole purpose of overloading `operator,`, allowing a cleaner matrix initialization syntax.
https://gitlab.com/libeigen/eigen/blob/master/Eigen/src/Core...
Re:C constructs that still don't work in C++
by spacechild1 on Monday May 25, 2026 @10:33PM
(#48274321)
Thanks!
As the title indicate, this article is comparing construct-to-construct, not idiomatic code to idiomatic code. You probably won't use struct initialization in C++, yet the feature still exist, so it may be useful to someone to compare it to the similar feature in C.
My pet peeve with C++ is that the sequence point operator can be overloaded at which point it stops being a sequence point.