#include <iostream>
class A
{
public:
A() { }
operator int() { return 10; };
operator float() const { return 2.0; };
};
class B
{
public:
B() { }
operator int() const { return 5; };
operator float() { return 1.0; };
};
int main()
{
A a;
B b;
std::cout << a + b << std::endl;
return 0;
}
Login in to like
Login in to comment