#include <iostream>
#include <cstddef> // for size_t
template< typename T > class
reset_impl_t;
template< typename T, ::std::size_t sz > class
reset_impl_t< T(&)[sz] >
{
public: static void
reset(T(&x)[sz])
{
(void) x; // not used
::std::cout << "array" << ::std::endl;
}
};
template< typename T > class
reset_impl_t< T * >
{
public: static void
reset(T * x)
{
(void) x; // not used
::std::cout << "pointer" << ::std::endl;
}
};
template< typename T > class
reset_impl_t< T * & >
{
public: static void
reset(T * x)
{
return(reset_impl_t< T * >::reset(x));
}
};
template< typename T > class
reset_impl_t< T & >
{
public: static void
reset(T & x)
{
(void) x; // not used
::std::cout << "reference" << ::std::endl;
}
};
template< typename T > void
reset(T && x)
{
return(reset_impl_t< T >::reset(x));
}
int main()
{
int nRetCode = 0;
char mass[10];
char * pmass = mass;
reset(mass);
reset(pmass);
reset(nRetCode);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0ZGRlZj4gLy8gZm9yIHNpemVfdAoKdGVtcGxhdGU8IHR5cGVuYW1lIFQgPiBjbGFzcwpyZXNldF9pbXBsX3Q7Cgp0ZW1wbGF0ZTwgdHlwZW5hbWUgVCwgOjpzdGQ6OnNpemVfdCBzeiA+IGNsYXNzCnJlc2V0X2ltcGxfdDwgVCgmKVtzel0gPgp7CglwdWJsaWM6IHN0YXRpYyB2b2lkCglyZXNldChUKCZ4KVtzel0pCgl7CgkJKHZvaWQpIHg7IC8vIG5vdCB1c2VkCgkJOjpzdGQ6OmNvdXQgPDwgImFycmF5IiA8PCA6OnN0ZDo6ZW5kbDsKCX0KfTsKCnRlbXBsYXRlPCB0eXBlbmFtZSBUID4gY2xhc3MKcmVzZXRfaW1wbF90PCBUICogPgp7CglwdWJsaWM6IHN0YXRpYyB2b2lkCglyZXNldChUICogeCkKCXsKCQkodm9pZCkgeDsgLy8gbm90IHVzZWQKCQk6OnN0ZDo6Y291dCA8PCAicG9pbnRlciIgPDwgOjpzdGQ6OmVuZGw7Cgl9Cn07Cgp0Z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