#include <iostream>
struct My
{
typedef int foo;
};
struct My2
{
};
template<typename T, typename I=typename T::foo> void Bar(const T&, I z = I())
{
std::cout << "My\n";
}
void Bar(...)
{
std::cout << "...\n";
}
int main()
{
My my;
Bar(my); // OK
My2 my2;
Bar(my2); // Also OK
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IE15CnsKICAgdHlwZWRlZiBpbnQgZm9vOwp9OwoKc3RydWN0IE15Mgp7Cn07Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBULCB0eXBlbmFtZSBJPXR5cGVuYW1lIFQ6OmZvbz4gdm9pZCBCYXIoY29uc3QgVCYsIEkgeiA9IEkoKSkKewoJc3RkOjpjb3V0IDw8ICJNeVxuIjsKfQoKdm9pZCBCYXIoLi4uKQp7CglzdGQ6OmNvdXQgPDwgIi4uLlxuIjsKfQoKaW50IG1haW4oKSAKewogICAgTXkgbXk7CiAgICBCYXIobXkpOyAvLyBPSwogICAgTXkyIG15MjsKICAgIEJhcihteTIpOyAvLyBBbHNvIE9LCiAgICByZXR1cm4gMDsKfQ==