#include <memory>
#include <iostream>
template <typename V, typename W>
struct foobar
{ static const int value = 0; };
template <typename V>
struct foobar<V, typename std::conditional<1==sizeof(V), std::true_type, std::false_type>::type>
{ static const int value = 1; };
template <typename V>
struct foobar<V, typename std::conditional<4==sizeof(V), std::true_type, std::false_type>::type>
{ static const int value = 4; };
int main()
{
int result = 0;
result = foobar<char, std::true_type>::value;
result = foobar<short, std::true_type>::value;
result = foobar<int, std::true_type>::value;
std::cout << "char : " << foobar<char, std::true_type>::value << std::endl;
std::cout << "short : " << foobar<short, std::true_type>::value << std::endl;
std::cout << "int : " << foobar<int, std::true_type>::value << std::endl;
return 0;
}
I2luY2x1ZGUgPG1lbW9yeT4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKCnRlbXBsYXRlIDx0eXBlbmFtZSBWLCB0eXBlbmFtZSBXPgpzdHJ1Y3QgZm9vYmFyCnsJc3RhdGljIGNvbnN0IGludCB2YWx1ZSA9IDA7IH07Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVj4Kc3RydWN0IGZvb2JhcjxWLCB0eXBlbmFtZSBzdGQ6OmNvbmRpdGlvbmFsPDE9PXNpemVvZihWKSwgc3RkOjp0cnVlX3R5cGUsIHN0ZDo6ZmFsc2VfdHlwZT46OnR5cGU+CnsJc3RhdGljIGNvbnN0IGludCB2YWx1ZSA9IDE7IH07Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVj4Kc3RydWN0IGZvb2JhcjxWLCB0eXBlbmFtZSBzdGQ6OmNvbmRpdGlvbmFsPDQ9PXNpemVvZihWKSwgc3RkOjp0cnVlX3R5cGUsIHN0ZDo6ZmFsc2VfdHlwZT46OnR5cGU+CnsJc3RhdGljIGNvbnN0IGludCB2YWx1ZSA9IDQ7IH07CgppbnQgbWFpbigpCnsKCWludCByZXN1bHQgPSAwOwoJcmVzdWx0ID0gZm9vYmFyPGNoYXIsIHN0ZDo6dHJ1ZV90eXBlPjo6dmFsdWU7CglyZXN1bHQgPSBmb29iYXI8c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