#include template bool allLeft(Args... args) { return (true && ... && args); } template bool allRight(Args... args) { return (args && ... && true); } int main(){ std::cout << std::boolalpha; std::cout << "allLeft(): " << allLeft() << std::endl; std::cout << "allRight(): " << allRight() << std::endl; std::cout << "allLeft(true): " << allLeft(true) << std::endl; std::cout << "allRight(true): " << allRight(true) << std::endl; std::cout << "allLeft(true, true, true, false): " << allLeft(true, true, true, false) << std::endl; std::cout << "allRight(true, true, true, false): " << allRight(true, true, true, false) << std::endl; }