#include <iostream>
void print(int i, std::string s){
std::cout << i << s;
}
bool print(std::pair<int, std::string> const & p){
print(p.first, p.second);
return true;
}
bool ea(){
return true;
}
template<typename ... T>
bool ea(std::pair<int, std::string> const & p, T&& ... t){
return print(p) && ea(std::forward<T>(t)...);
}
template<typename ... T>
bool ea(std::pair<int, std::string> const & p, T&& ... t){
return print(p) && ea(std::forward<T>(t)...);
}
int main() {
ea({1, "a"}, {2, "b"});
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBwcmludChpbnQgaSwgc3RkOjpzdHJpbmcgcyl7CiAgICBzdGQ6OmNvdXQgPDwgaSA8PCBzOwp9Cgpib29sIHByaW50KHN0ZDo6cGFpcjxpbnQsIHN0ZDo6c3RyaW5nPiBjb25zdCAmIHApewogICAgcHJpbnQocC5maXJzdCwgcC5zZWNvbmQpOwogICAgcmV0dXJuIHRydWU7Cn0KYm9vbCBlYSgpewogICAgIHJldHVybiB0cnVlOwp9Cgp0ZW1wbGF0ZTx0eXBlbmFtZSAuLi4gVD4KYm9vbCBlYShzdGQ6OnBhaXI8aW50LCBzdGQ6OnN0cmluZz4gY29uc3QgJiBwLCBUJiYgLi4uIHQpewogICAgcmV0dXJuIHByaW50KHApICYmIGVhKHN0ZDo6Zm9yd2FyZDxUPih0KS4uLik7Cn0KCnRlbXBsYXRlPHR5cGVuYW1lIC4uLiBUPgpib29sIGVhKHN0ZDo6cGFpcjxpbnQsIHN0ZDo6c3RyaW5nPiBjb25zdCAmIHAsIFQmJiAuLi4gdCl7CiAgICByZXR1cm4gcHJpbnQocCkgJiYgZWEoc3RkOjpmb3J3YXJkPFQ+KHQpLi4uKTsKfQppbnQgbWFpbigpIHsKICAgIGVhKHsxLCAiYSJ9LCB7MiwgImIifSk7CglyZXR1cm4gMDsKfQoKCg==
prog.cpp:21:6: error: redefinition of ‘template<class ... T> bool ea(const std::pair<int, std::__cxx11::basic_string<char> >&, T&& ...)’
bool ea(std::pair<int, std::string> const & p, T&& ... t){
^~
prog.cpp:16:6: note: ‘template<class ... T> bool ea(const std::pair<int, std::__cxx11::basic_string<char> >&, T&& ...)’ previously declared here
bool ea(std::pair<int, std::string> const & p, T&& ... t){
^~
prog.cpp: In function ‘int main()’:
prog.cpp:25:26: error: no matching function for call to ‘ea(<brace-enclosed initializer list>, <brace-enclosed initializer list>)’
ea({1, "a"}, {2, "b"});
^
prog.cpp:11:6: note: candidate: ‘bool ea()’
bool ea(){
^~
prog.cpp:11:6: note: candidate expects 0 arguments, 2 provided
prog.cpp:16:6: note: candidate: ‘bool ea(const std::pair<int, std::__cxx11::basic_string<char> >&, T&& ...) [with T = {}]’
bool ea(std::pair<int, std::string> const & p, T&& ... t){
^~
prog.cpp:16:6: note: candidate expects 1 argument, 2 provided