#include <iostream>
template <typename T, typename U = T>
class Reduce {
public:
Reduce(T *t, U *u) { std::cout << "Double argument.\n";}
};
template <typename T>
class Reduce<T,T> {
public:
Reduce(T *t) { std::cout << "Single argument.\n"; }
};
int main()
{
Reduce<int, float> r(new int, new float);
Reduce<int> r2(new int); // partial template specialization?
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHR5cGVuYW1lIFUgPSBUPgpjbGFzcyBSZWR1Y2UgewogIHB1YmxpYzoKICAgIFJlZHVjZShUICp0LCBVICp1KSB7ICBzdGQ6OmNvdXQgPDwgIkRvdWJsZSBhcmd1bWVudC5cbiI7fQp9OwoKdGVtcGxhdGUgPHR5cGVuYW1lIFQ+CmNsYXNzIFJlZHVjZTxULFQ+IHsKICBwdWJsaWM6CiAgICBSZWR1Y2UoVCAqdCkgeyBzdGQ6OmNvdXQgPDwgIlNpbmdsZSBhcmd1bWVudC5cbiI7IH0KfTsKCmludCBtYWluKCkKewogICAgICAgUmVkdWNlPGludCwgZmxvYXQ+IHIobmV3IGludCwgbmV3IGZsb2F0KTsKICAgICAgIFJlZHVjZTxpbnQ+IHIyKG5ldyBpbnQpOyAvLyBwYXJ0aWFsIHRlbXBsYXRlIHNwZWNpYWxpemF0aW9uPwoKICAgIHJldHVybiAwOwp9Cg==