#include class Car { private: Car(){}; int _no; public: Car(int no) { _no=no; } void printNo() { std::cout<<_no<
I don't think there's type-safe method that can do what you want.