class A
{
public:
A(int ) // not giving the int parameter a name because we don't use it
{
}
};
class B
{
public:
explicit B(int )
{
}
};
void func_a(A )
{
}
void func_b(B )
{
}
int main()
{
func_a(A(100)); // works
func_a(200); // works!
func_b(B(100)); // works
func_b(200); // doesn't work!
}
Y2xhc3MgQQp7CnB1YmxpYzoKCiAgICBBKGludCApIC8vIG5vdCBnaXZpbmcgdGhlIGludCBwYXJhbWV0ZXIgYSBuYW1lIGJlY2F1c2Ugd2UgZG9uJ3QgdXNlIGl0CiAgICB7CiAgICB9Cn07CgpjbGFzcyBCCnsKcHVibGljOgoKICAgIGV4cGxpY2l0IEIoaW50ICkKICAgIHsKICAgIH0KfTsKCnZvaWQgZnVuY19hKEEgKQp7Cn0KCnZvaWQgZnVuY19iKEIgKQp7Cn0KCmludCBtYWluKCkKewogICAgZnVuY19hKEEoMTAwKSk7IC8vIHdvcmtzCiAgICBmdW5jX2EoMjAwKTsgLy8gd29ya3MhCiAgICBmdW5jX2IoQigxMDApKTsgLy8gd29ya3MKICAgIGZ1bmNfYigyMDApOyAvLyBkb2Vzbid0IHdvcmshCn0K