3 ms·
Putting it through a for loop demonstrates that it is iterable, imo. template <typename T> void foo(const T& container) { for (auto value : container)
by lanyard-textile 1y ago
Putting it through a for loop demonstrates that it is iterable, imo.
template <typename T>
void foo(const T& container) {
for (auto value : container) {
// process value
}
}
foo(std::vector<int>())
foo(std::optional<int>())