#include <utility>
template<template<typename,typename>class checker, typename... Ts>
struct is_all : std::true_type {};
template<template<typename,typename>class checker, typename T0, typename T1, typename... Ts>
struct is_all<checker, T0, T1, Ts...> :
std::integral_constant< bool, checker<T0, T1>::value && is_all<checker, T0, Ts...>::value>
{};
template<typename... Ts>
using is_all_same = is_all< std::is_same, Ts... >;
#include <iostream>
int main() {
std::cout << is_all_same<int, int>::value << is_all_same<double, double, int>::value << is_all_same<int, int, int, int, int>::value << "\n";
}
I2luY2x1ZGUgPHV0aWxpdHk+Cgp0ZW1wbGF0ZTx0ZW1wbGF0ZTx0eXBlbmFtZSx0eXBlbmFtZT5jbGFzcyBjaGVja2VyLCB0eXBlbmFtZS4uLiBUcz4Kc3RydWN0IGlzX2FsbCA6IHN0ZDo6dHJ1ZV90eXBlIHt9OwoKdGVtcGxhdGU8dGVtcGxhdGU8dHlwZW5hbWUsdHlwZW5hbWU+Y2xhc3MgY2hlY2tlciwgdHlwZW5hbWUgVDAsIHR5cGVuYW1lIFQxLCB0eXBlbmFtZS4uLiBUcz4Kc3RydWN0IGlzX2FsbDxjaGVja2VyLCBUMCwgVDEsIFRzLi4uPiA6CiAgc3RkOjppbnRlZ3JhbF9jb25zdGFudDwgYm9vbCwgY2hlY2tlcjxUMCwgVDE+Ojp2YWx1ZSAmJiBpc19hbGw8Y2hlY2tlciwgVDAsIFRzLi4uPjo6dmFsdWU+Cnt9OwoKdGVtcGxhdGU8dHlwZW5hbWUuLi4gVHM+CnVzaW5nIGlzX2FsbF9zYW1lID0gaXNfYWxsPCBzdGQ6OmlzX3NhbWUsIFRzLi4uID47CgojaW5jbHVkZSA8aW9zdHJlYW0+CgppbnQgbWFpbigpIHsKICAgIHN0ZDo6Y291dCA8PCBpc19hbGxfc2FtZTxpbnQsIGludD46OnZhbHVlIDw8IGlzX2FsbF9zYW1lPGRvdWJsZSwgZG91YmxlLCBpbnQ+Ojp2YWx1ZSA8PCBpc19hbGxfc2FtZTxpbnQsIGludCwgaW50LCBpbnQsIGludD46OnZhbHVlIDw8ICJcbiI7Cn0=