#include <typeinfo>
#include <iostream>
template <class T, class U>
struct is_same
{
static const bool value = false;
};
template <class T>
struct is_same<T, T>
{
static const bool value = true;
};
struct S
{
long a:3;
char b:5;
char c:1;
};
template <class T, class U>
void print_is_same(T, U)
{
std::cout << typeid(T).name() << " is " << (is_same<T,U>::value? "" : "not ") << "same as " << typeid(U).name() << std::endl;
}
int main()
{
S s;
print_is_same(s.a, s.b);
print_is_same(s.b, s.c);
}
I2luY2x1ZGUgPHR5cGVpbmZvPgojaW5jbHVkZSA8aW9zdHJlYW0+Cgp0ZW1wbGF0ZSA8Y2xhc3MgVCwgY2xhc3MgVT4Kc3RydWN0IGlzX3NhbWUKewoJc3RhdGljIGNvbnN0IGJvb2wgdmFsdWUgPSBmYWxzZTsKfTsKCnRlbXBsYXRlIDxjbGFzcyBUPgpzdHJ1Y3QgaXNfc2FtZTxULCBUPgp7CglzdGF0aWMgY29uc3QgYm9vbCB2YWx1ZSA9IHRydWU7Cn07CgpzdHJ1Y3QgUwp7Cglsb25nIGE6MzsKCWNoYXIgYjo1OwoJY2hhciBjOjE7Cn07Cgp0ZW1wbGF0ZSA8Y2xhc3MgVCwgY2xhc3MgVT4Kdm9pZCBwcmludF9pc19zYW1lKFQsIFUpCnsKCXN0ZDo6Y291dCA8PCB0eXBlaWQoVCkubmFtZSgpIDw8ICIgaXMgIiA8PCAoaXNfc2FtZTxULFU+Ojp2YWx1ZT8gIiIgOiAibm90ICIpIDw8ICJzYW1lIGFzICIgPDwgdHlwZWlkKFUpLm5hbWUoKSA8PCBzdGQ6OmVuZGw7Cn0KCmludCBtYWluKCkKewoJUyBzOwoJcHJpbnRfaXNfc2FtZShzLmEsIHMuYik7CglwcmludF9pc19zYW1lKHMuYiwgcy5jKTsKfQ==