title: Change number of members depending on constructor called
body: <p>I need a template class, which has different members, depending on which ctor is called.
  I managed to get a class, which has different members using sfinae with a base class (I did it almost like this <a href="https://stackoverflow.com/questions/25492589/can-i-use-sfinae-to-selectively-define-a-member-variable-in-a-template-class">SFINAE on member variable</a>).
  Now my question is, can I achieve a single template class, which has different members, depending on which ctor of the class is called?
  Maybe someone can has an idea how to achieve this.</p>
  
  <p>EDIT: I currently use <code>boost::variant</code>, but the problem is, that the largest object in the variant is huge, and the the smallest is ust a pointer. this is a real performance problem, because most of the time the pointer will be in the variant.</p>
  
  <p>EDIT II: If this would work with a ctor it would be awesome, but if not, a factory-fuction would work as well.</p>
  
  <p>EDIT III (or what I am trying to achieve):
  I am currently making a DSL, which translates to C++.
  Since I am trying to make polymorphism possible, I am only passing pointers to functions. Beacause some pointers are reference counted and some pointers are raw, depending on what the user wants, there can be shared_pointers and raw pointers of the same class. Thats why I can't make two different classes, because if a function is called on a pointer, it should be the same function, otherwise I have to overload all the fnctions, which would give me 
  2**n functions when the function has n arguments.
  Thats why I am trying to create a class, which could eigther represents a raw pointer or a shared_ptr, based on what is passed to the ctor.</p>