title: Instantiation of Base class using Derived classes without using pointers in Object definition
body: <p>Regarding <a href="https://stackoverflow.com/questions/4057774/instantiation-of-objects-in-conditionals-c">this question</a> i saw all the answers are using pointer to base class(<code>Base *baseObject</code>) and then use <code>new</code> keyword to instantiate different implementations of base class.</p>
  <p>let's say if there is a <code>Base</code> Class like this:</p>
  <pre><code>class Base
  {
      public:
             int Id;
  }
  </code></pre>
  <p>and other classes like this:</p>
  <pre><code>class A : public Base {...}
  class B : public Base {...}
  </code></pre>
  <p>is there anyway to instantiate a Base Class object Conditionally but without using pointers, like this:</p>
  <pre><code>Base a;
  if (...) a = new A();
  else if (...) a = new B()
  </code></pre>
  <p><strong>Edit:</strong></p>
  <p>Based on comments there is no force to use <code>new</code> keyword.</p>