Tag: boost::any questions
boost::any questions
Question 1: Will this code compile : Advertisements #include <iostream> #include “boost/any.hpp” class Node { private: int value; Node(const Node & obj) { value = obj.value; } public: Node(int i) { value = i; } }; int main() { boost::any var1 = new Node(5); return 0; } Answer: [code collapse=”true”] Yes, because we are storing …