Multidimensional operator[] from c++23 support in nvc++

Hello,

I see on the cpp reference c++23 page that nvc++ does not support the multidimensional operator[] introduced by P2128R6.

I would really like to use this feature in my codebase. The other compilers that I need to support (GCC, CLANG, and ICX) have implemented this feature for a few major versions, so I was curious if nvc++ would support this in the near future. I think it would be a good feature for NVIDIA’s scientific computing community since it can make multidimensional indices more readable.

Thanks for your time,
Josh

Hi Josh,

I believe we added this support back in our 25.9 release. You can download our latest release at: NVIDIA HPC SDK Current Release Downloads | NVIDIA Developer

To test, I used the example codes found at: operator overloading - cppreference.com

% nvc++ -V25.9 test1.cpp --std=c++23 ; a.out
v[3, 2, 1] = 42
% nvc++ -V25.9 test2.cpp --std=c++23 ; a.out
3/8 * 1/2 = 3/16
1/2 * 5/1 = 5/2
2 * 3/8 = 3/4

Hope this helps,
Mat

That compiler version seems to have worked for me. Thank you!