fold expression and function name lookup
问题 I am learning fold expressions in C++17. I have the following code #include <iostream> #include <vector> namespace io { template<typename T> std::istream &operator>>(std::istream &in, std::vector<T> &vec) { for (auto &x : vec) in >> x; return in; } template<class... Args> void scan(Args &... args) { (std::cin >> ... >> args); } }// namespace io int main() { std::vector<int> s(1), t(1); io::scan(s, t); std::cout << s[0] << ' ' << t[0] << '\n'; } Using GCC 9.3.0, the code compiles and runs