News for hackers. Stuff that matters.
Re:C++ by Example by jvanderbot on Thursday September 22, 2022 @09:51AM (#32938725)
Yeah, it's fairly basic, and most of this is in the usual c++ docs like cppreference.com

But... Is template meta-programming a required feature of a C++ dev?

double-bracket is ... an edge case of usual [] overloading, isn't it?

Re:C++ by Example by ur-whale on Thursday September 22, 2022 @10:00AM (#32938840)
These are just examples to make a point.

And: https://arne-mertz.de/2016/12/modern-c-features-attributes/

Re:C++ by Example by stonemetal12 on Thursday September 22, 2022 @10:21AM (#32939130)
Templates are a major feature of the language, leaving it out seems a little weird.
Re:C++ by Example by d_tr on Thursday September 22, 2022 @11:41AM (#32940502)
Looks like an ongoing work so more will probably be available in the future. I see an example for templates. Template metaprogramming is more advanced but would be nice to include.
Re:C++ by Example by sva_ on Thursday September 22, 2022 @01:44PM (#32942246)
Re:C++ by Example by ur-whale on Thursday September 22, 2022 @03:55PM (#32943862)
That's just templates.

I'm talking about stuff like this:

https://en.wikipedia.org/wiki/Template_metaprogramming#Stati...

Re:C++ by Example by ncmncm on Thursday September 22, 2022 @01:21PM (#32941922)
It has been years since I was tempted to template metaprogramming. It is a specialist technique being made redundant by straightforward language features that compile much faster.
Re:C++ by Example by jvanderbot on Thursday September 22, 2022 @07:17PM (#32945887)
Yeah. I've never seen this in practice except as premature optimization or solving a problem in code that can be solved easier elsewhere.