Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #312 Test for list equality

Set b to true if the lists p and q have the same size and the same elements, false otherwise.

#include <algorithm>
bool b = ::std::ranges::equal(p, q);

New implementation...
< >
programming-idioms.org