What is the fastest method to check if all elements of an array(preferable integer array) are equal. Till now I have been using the following code:
bool chec
For programmer efficiency you may try the following all in one line.
vector v{1, 1, 1, 1}; all_of(v.cbegin(), v.cend(), [&r=v[0]](int value){ return value == r; }->bool);
I did not test run this code, let me know if there is syntax error.