title: Constrained constructor in class hierarchy, C++
body: <p>Let's say I have two classes, abstract classes.</p>
  
  <pre><code>class A {
  //code...
  };
  class B {
  public:
    B(A *x);
  };
  </code></pre>
  
  <p>And I extend both classes as follows:</p>
  
  <pre><code>class A1 : public A {
  };
  class A2 : public A {
  };
  
  class B1 : public B {
  public:
     B1(A1 *x);
  };
  class B2 : public B {
     B2(A2 *x);
  };
  </code></pre>
  
  <p>This means that a <code>B1</code> object can be instantiated using only a <code>A1</code>, while <code>B2</code> necessarily need a <code>B1</code> object right? There's no chance I could mix things, using A2 for instantiate B1 for example. This is because the classes <code>A,B</code> are abstracts. What about if <code>A,B</code> are not abstract? does it change something?</p>