Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>An extended comment on UncleBens' answer.</p> <p>It is always good to keep in mind that class templates are not classes. They are templates. One way to look at it: In C++, classes are not objects. You need to instantiate a class to create an object. A similar concept applies to class templates and classes. Just as class instantiation creates an object, class template instantiation creates a class.</p> <p>Until the template is instantiated, that inheritance relationship you set up between <code>unorderedArrayListType</code> and <code>arrayListType</code> doesn't quite exist. The compiler does not know if you are going to define a partial template instantiation of <code>arrayListType</code> that doesn't have <code>length</code> and <code>list</code> as data members. You need to give the compiler a hand in your <code>unorderedArrayListType</code> by using <code>this-&gt;length</code> and <code>this-&gt;list</code> or some other construct that tells the compiler that you do expect these to be data members.</p> <p>Suppose you use <code>this-&gt;length</code> in <code>unorderedArrayListType</code>, and suppose that someone comes along and writes a partial template instantiation of <code>arrayListType&lt;FooType&gt;</code> that does not have <code>length</code> and <code>list</code> as data members. Now instantiating an <code>unorderedArrayListType&lt;FooType&gt;</code> will result in compile time error. But since you aren't going to do that (you aren't going to do that, are you?), using <code>this-&gt;length</code> will be OK.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload