What will be printed out as a result of the following code execution?
#include <iostream>

class Rose {};

class A { public: typedef Rose rose; };

template<typename T>
class B: public T { public: typedef typename T::rose foo; };

template<typename T>
void smell(T) { std::cout << "Awful!" << std::endl; }
void smell(Rose) { std::cout << "Awesome!" << std::endl; }

int main()
{
    smell(A::rose());
    smell(B<A>::foo());
    return 0;
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes