title: 'domain_error' in namespace 'std' does not name a type
body: <p>I am trying to implement a generic matrix and I got an errors on each decleration of domain_error in my code..</p>
  
  <p>error:</p>
  
  <pre><code>Matrix.h:31:60: error: 'domain_error' in namespace 'std' does not name a type
       Matrix operator+(const Matrix &amp;other) const throw(std::domain_error);
  
   Matrix&lt;T&gt; Matrix&lt;T&gt;::operator+(const Matrix &amp;other) const throw(std::domain_error)
                                                                        ^
  Matrix.hpp:94:27: error: 'domain_error' in namespace 'std' does not name a type
               } catch (std::domain_error e)
                             ^
  Matrix.hpp:96:23: error: 'e' was not declared in this scope
                   throw e;
                         ^
  </code></pre>
  
  <p>for example the operator '+':</p>
  
  <p>Matrix.h:</p>
  
  <pre><code>#include &lt;exception&gt;
  #include &lt;vector&gt;
  #include &lt;iostream&gt;
  #include &lt;cstdlib&gt;
  typedef typename std::vector&lt;T&gt; genericVector;
  
  Matrix operator+(const Matrix &amp;other) const throw(std::domain_error);
  </code></pre>
  
  <p>Matrix.hpp:</p>
  
  <pre><code>template&lt;class T&gt;
  
  Matrix&lt;T&gt; Matrix&lt;T&gt;::operator+(const Matrix &amp;other) const throw(std::domain_error)
  {
      if (!compareSize(*this, other)) // check if matricies have the same dimensions
      {
          throw std::domain_error(
                  "illegal use of operator '+' on matrices with different dimensions.");
      }
  
      genericVector temp; // initialize a new vector&lt;T&gt;
      for (unsigned int i = 0; i &lt; _rows; ++i)
      {
          for (unsigned int j = 0; j &lt; _cols; ++j)
          {
              try
              {
                  temp.push_back(_cells[_cols * i + j] + other(i, j)); // sum matricies to vector
              } catch (std::domain_error e) // if thrown domain error..
              {
                  throw e;
              }
          }
      }
  
      return Matrix(_rows, _cols, temp); // return the sum of matrices
  }
  </code></pre>
  
  <p>Also I include ..</p>
  
  <p>thanks all!</p>