What will be printed as a result of execution of the following code?
#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;
}

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести