ZeroTierOne/ext/libpqxx-7.7.3/config-tests/multidim-subscript.cxx

15 lines
231 B
C++
Raw Normal View History

2022-06-23 17:24:33 +00:00
// Test for multidimensional subscript operator support.
// Proposed for C++23: P2128R6.
struct table
{
int width = 100;
int operator[](int x, int y) const { return x + width * y; }
};
int main()
{
return table{}[0, 0];
}