How to find distinct pairs using std::ranges?

Viewed 34

What's the best way to find distinct pairs in an array? In other words - how to rewrite the code below using std::ranges

for (int i = 0; i < N; ++i)
    for (int j = i+1; j < N; ++j)
        generate_pair(X[i], X[j]);
0 Answers
Related