title: is this a typo or am i missing something?
body: <p>Good day, I am going over Bjarne Stroustrup's "The C++ programming language" and I am facing a snippet of code which I think should be illegal, but is presented in the text. </p>
  
  <p>I am wondering if this is merely a slight oversight, or if there is something that I am missing. </p>
  
  <p>starting from chapter 3 page 63: 
  we have user defined type Vector as follows:</p>
  
  <pre><code>class Vector {
      private:
      double* elem; // elem points to an array of sz doubles
      int sz;
  
      public:
      Vector(int s) :elem{new double[s]}, sz{s} // constructor: acquire resources
      {
              for (int i=0; i!=s; ++i) elem[i]=0; // initialize elements
      }
  
      Vector(std::initializer_list&lt;double&gt;)
      {
      // initialize with a list
      } 
      // ...
      void push_back(double)
      { 
      // add element at end increasing the size by one
      }
  
      ~Vector() {
       delete[] elem; 
       } // destructor: release resources
  
      double&amp; operator[](int i);
  
      int size() const;
      };
  </code></pre>
  
  <p>notice there are 2 constructors for Vector, one with only size, another with a full initializer list looking like {2.0, 3.1, 4}</p>
  
  <p>now we go on to define an abstract class called "Container", it looks like this: </p>
  
  <pre><code>class Container {
      public:
      virtual double&amp; operator[](int) = 0; // pure virtual function
      virtual int size() const = 0; // const member function (pure virtual) 
      virtual ~Container() {} // destructor 
      };
  </code></pre>
  
  <p>and at this point Bjarne wants to demonstrate the "abstractness" of Container by defining a concrete class that inherits from Container, and happens to use a Vector field for its internal use. here it is:</p>
  
  <pre><code>    class Vector_container : public Container { // Vector_container implements Container
              Vector v;
              public:
              Vector_container(int s) : v(s) { } // Vector of s elements
              ~Vector_container() {}
              double&amp; operator[](int i) { return v[i]; }
              int size() const { return v.size(); }
        };
  </code></pre>
  
  <p>notice that Vector_container, uses a Vector object internally. this class has only one explicit constructor that takes in the size of the container (and uses that size to pass in the constructor of its internal Vector). </p>
  
  <p>now recall that Vector has yet another constructor of the form: Vector(std::initializer_list)</p>
  
  <p>this is all fine and dandy but what confuses me is that the textbook goes on to present this code:</p>
  
  <pre><code> void g()
   {
       Vector_container vc {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0};
       // use vc as a Container type
   }
  </code></pre>
  
  <p>as you can see, vc which is an instance of Vector_container, is being passed an initializer list to its constructor. this confuses me. there was no mention of such constructor in the definition of Vector_container. </p>
  
  <p>what am I missing here?
  Thanks</p>