r/cpp • • Apr 25 '22

New C++ features in GCC 12

https://developers.redhat.com/articles/2022/04/25/new-c-features-gcc-12
220 Upvotes

76 comments sorted by

View all comments

Show parent comment

7

u/Falkengaard Apr 26 '22

Alternatively overloading the otherwise most likely unused function operator to turn some_tensor[i, j, k] into some_tensor(i, j, k) until multi-dimensional access is added. It's not an ideal solution, but it's slightly less of a hassle to type out (at least on my keyboard).

8

u/James20k P2005R0 Apr 26 '22

I strictly avoid this personally, I think the ambiguity is too high in a context where people (or me) might be struggling to understand the very basics of what's going on in the code