std::array has a built-in function empty() to check if the array is empty. As shown in the example copied from here.
#include #include