3 ms·
If you use std::begin and std::end instead of the member functions this will even work with old-school C-style arrays.
by electricslpnsld 9y ago
If you use std::begin and std::end instead of the member functions this will even work with old-school C-style arrays.
- emmelaich 9y agoYes, and you can even use the range syntax instead of begin/end. Here's a file with a few different ways https://gist.github.com/anonymous/78b4f257e60d55537b36e2e4f3c6de9d https://gist.github.com/anonymous/78b4f257e60d55537b36e2e4f3...
- emmelaich 9y ago.. and Herb Sutter recommends those free functions over the member functions for this reason -- genericity.