template<typename... Args>↵
bool allTrue(Args... args) {↵
return (args && ...);↵
}↵
↵
template<typename... Args>↵
bool anyTrue(Args... args) {↵
return (args || ...);↵
}↵
↵
template<typename... Args>↵
void printAll(Args... args) {↵
((cout << args << " "), ...);↵
cout << endl;↵
}↵
↵
cout << "All true: " << allTrue(true, true, true) << endl;↵
cout << "All true: " << allTrue(true, false, true) << endl;↵
cout << "Any true: " << anyTrue(false, true, false) << endl;↵
printAll(1, 2.5, "hello", 'x');