title: error: expected ‘)’ before ‘<’ token
body: <p>I'm trying to learn c++ following a book. I've wrote this class definition using std::initializer_list in order to initialize a vector with a list of elements. Vector.h file looks this way:</p>
  
  <pre><code>class Vector
  {
  public:
      Vector(int s);
      ~Vector();
      Vector(std::initializer_list&lt;double&gt;);
      void push_back(double);
      double&amp; operator[](int i);
      int size();
  private:
      double* elem;
      int sz;
  };
  </code></pre>
  
  <p>When I try to compile I have this error message in line 6 (initializer_list one):</p>
  
  <pre><code>error: expected ‘)’ before ‘&lt;’ token
  </code></pre>
  
  <p>I've also added this code to implement Vector constructor. Vector.cpp looks this way</p>
  
  <pre><code>#include "Vector.h"
  #include &lt;stdexcept&gt;
  
  using namespace std;
  
  Vector::Vector(int s)
  {
      if(s &lt; 0)
      {
          throw length_error("Vector::operator[]");
      }
      elem = new double[s];
      sz = s;
  }
  
  Vector::~Vector()
  {
       delete[] elem;
  }
  
  Vector::Vector(std::initializer_list&lt;double&gt; lst)
  {
      elem = new double[lst.size()];
      sz = static_cast&lt;int&gt;(lst.size());
  
      copy(lst.begin(), lst.end(), elem);
  }
  
  double&amp; Vector::operator[](int i)
  {
      if(i&lt;0 || i&gt;=size())
      {
          throw out_of_range("Vector::operator[]");
      }
      return elem[i];
  }
  
  int Vector::size()
  {
      return sz;
  }
  </code></pre>
  
  <p>but compilation also fails with this message:</p>
  
  <pre><code>error: expected constructor, destructor, or type conversion before ‘(’ token
  </code></pre>
  
  <p>I'm using Code::Blocks width GNU GCC compiler and no extra compiler flags activated. I've tried checking "Have g++ follow the comming C++0x ISO C++ language standard [-std=c++0x]" in Code::Blocks, but errors remain and three new ones raise.</p>