When iterating over a standard container, do you think it’s a good idea to omit the std:: prefix and rely on ADL to find the definition? Example:
std::vector<int> vec = get_vec();
// range-based for loop would be preferred here, but just for the sake of example
for (auto it = begin(vec), end = end(vec); it != end; ++it) { /*...*/ }
Are there any reasons to do or not do this?
If you’re going to use ADL to be able to change the container type without changing the loops, then add
using std::begin; using std::end;. That makes sure it finds thestdfunctions for containers from other namespaces that havebeginandendmembers, but no free functions in their namespace.