title: Can I tell if a std::type_info object is equal to another OR a class derived from that other?
body: <p>I have a Factory that has shops that work on unrelated things.  Some shops work or personal autos and classes derived from there ( cars, SUVs, mopeds ) and others work on military vehicles and classes derived from there ( tanks, planes, submarines ).</p>
  
  <p>This question relates to my Factory class, which doesn't care about what is being made in the shops, but it does provide some services to make sure the right types of vehicles are being routed to the right shops.  i.e., if a Audi A4 shows up at the loading dock, it needs to be identified as a personal auto and routed to the personal auto shop.</p>
  
  <p>Can I do this without declaring the types of vehicles possible in the Factory class?</p>
  
  <p>So, in more C++ coding specifics, I thought my Factory could have a <code>std::map&lt;shop *, const std::type_info *&gt;</code> container where where the <code>std::type_info *</code> was provided by the shops, and points to the base class of vehicle (e.g., personal auto, or military vehicle).
  But..., I have not been able to figure out a way to check if one <code>std::type_info</code> for an object is the same as a candidate <strong>OR</strong> derived from that candidate.</p>
  
  <p>If the Factory knew of at least the base vehicle types (personal auto and military vehicle), I am aware of how to use <code>dynamic_cast&lt;&gt;()</code> acting on personal auto pointers or military vehicle pointers to check for type equality or that one is derived from the base.  However, I am hoping to make the factory as general as possible.</p>
  
  <p>Any ideas?</p>