title: select specialization of template class using a string
body: <p>I have several types created using policies, i.e.</p>
  
  <pre><code>template &lt;typename PolicyA, typename PolicyB&gt;
  class BaseType : PolicyA, PolicyB
  {};
  
  struct MyPolicyA {};
  struct MyPolicyB {};
  struct OtherPolicyB {};
  
  using SpecializedTypeX = BaseType&lt;MyPolicyA, MyPolicyB&gt;;
  using SpecializedTypeY = BaseType&lt;MyPolicyA, OtherPolicyB&gt;;
  </code></pre>
  
  <p>Now I would like to introduce some mechanism which allows me to elegantly select which SpecializedType should be used basing on input from e.g. command line. Ideally, it would be a factory method creating object of the proper type, like:</p>
  
  <pre><code>auto CreateSelectedSpecializedType(const std::string &amp;key);
  
  // selected has type SpecializedTypeX
  auto selected = CreateSelectedSpecializedType("SpecializedTypeX");  
  </code></pre>
  
  <p>I'd appreciate any advice. Thanks!</p>