title: C++ - using parent class attributes
body: <p>I am writing a general Vector class and I want a Vector3 class to inherit from Vector. Vector's data can be of any length, Vector3's data is of length 3. So I want to make a different constructor for Vector3 which accesses the Vector's data and length. For this question I simplified the code.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  
  template &lt;typename T&gt;
  class A {
  protected:
      T value;
  
  public:
      A()
      : value(0)
      {};
  
      A(T value)
      : value(value)
      {};
  
      ~A ()
      {};
  
      T get_value()
      {
          return value;
      }
  };
  
  template &lt;typename T&gt;
  class B : public A&lt;T&gt; {
  public:
      B()
      : A&lt;T&gt;(3)
      {};
  
      T test()
      {
          return value; // error: 'value' was not declared in this scope
      }
  };
  </code></pre>
  
  <p>As I said I want to access 'value' in the child class 'B', however I get the error notification</p>
  
  <blockquote>
    <p>error: 'value' was not declared in this scope</p>
  </blockquote>
  
  <p>However according to the c++ website (<a href="http://www.cplusplus.com/doc/tutorial/polymorphism/" rel="nofollow noreferrer">http://www.cplusplus.com/doc/tutorial/polymorphism/</a>) I should be able to access 'value'.</p>
  
  <p>Why is this, and more important, how do I solve this?</p>