T
Tim H
I understand why this is ambiguous, technically, but it seems,
frankly, retarded to consider 0 as ambiguous but 1 as not, just
because 0 == NULL.
Is there any way to defeat this that does not involve changing all
code that uses 0 as an argument to use bignum(0)?
#include <string>
using namespace std;
class bignum
{
public:
bignum(int val) {}#include <string>
using namespace std;
class bignum
{
public:
bignum(int val) {}
};
int
foo(bignum arg)
{
return 0;
}
int
foo(const string &arg)
{
return 0;
}
int
main()
{
foo("hello");
foo(1);
foo(0);
return 0;
}
};
int
foo(bignum arg)
{
return 0;
}
int
foo(const string &arg)
{
return 0;
}
int
main()
{
foo("hello");
foo(1);
foo(0);
return 0;
}
frankly, retarded to consider 0 as ambiguous but 1 as not, just
because 0 == NULL.
Is there any way to defeat this that does not involve changing all
code that uses 0 as an argument to use bignum(0)?
#include <string>
using namespace std;
class bignum
{
public:
bignum(int val) {}#include <string>
using namespace std;
class bignum
{
public:
bignum(int val) {}
};
int
foo(bignum arg)
{
return 0;
}
int
foo(const string &arg)
{
return 0;
}
int
main()
{
foo("hello");
foo(1);
foo(0);
return 0;
}
};
int
foo(bignum arg)
{
return 0;
}
int
foo(const string &arg)
{
return 0;
}
int
main()
{
foo("hello");
foo(1);
foo(0);
return 0;
}