title: No matching function error when I try to throw an exception
body: <p>I have this code:</p>
  
  <pre><code>class RepoException
  {
  
  public:
  
      RepoException(string&amp; msg)
      {
          this-&gt;msg=msg;
      }
  
      string&amp; getMsg()
      {
          return this-&gt;msg;
      }
  
  private:
  
      string msg;
  };
  
  template&lt;typename T&gt;
  class Repo 
  {
  
  public:
  
      Repo()
      {
          vector&lt;T&gt; elems;
      }
  
      void store(T elem) throw (RepoException)
      {
          for(int i =0; i&lt;elems.size();i++)
          {
              if (elems[i]-&gt;getId() == elem-&gt;getId())
              {
                  throw RepoException("There is a person with same id ");
              }
  
          }
          elems.push_back(elem);
      }
  </code></pre>
  
  <p>In the function <code>store</code>, when I try to throw the exception I get this error:</p>
  
  <pre><code>  Multiple markers at this line
      - candidates are:
      - no matching function for call to 'RepoException::RepoException(const 
  </code></pre>
  
  <p>Why do I get this error? </p>