C++ Class Writing Interview Query
I would strongly recommend making name field const. Also, typeid(*this).name() won't look nice and pretty in some compilers.
You should probably try something like:

class Tool {
public:
  const std::string name;
  &lt;...&gt;
protected:
  Tool(const char* className) : name(className) {}
private:
  &lt;...&gt;
}


BTW, do NOT expect typeid(*this).name(); to be called for deriven object. Even virtual functions won't help, so you can't write something like virtual const char* getMyName() = 0;, because any kind of "virtual" behavior will not work in constructor.