title: c++: function cannot be overloaded
body: <p>I am encountering a compile time error with the following output:</p>
  
  <pre><code>$ g++ -ggdb `pkg-config --cflags opencv` -o `basename main.cpp .cpp` main.cpp StringMethods/StringMethods.cpp `pkg-config --libs opencv` -std=c++0x
  In file included from main.cpp:2:0:
  VideoFile.hpp:32:10: error: ‘bool VideoFile::fileExists(const string&amp;)’ cannot be overloaded
       bool fileExists(const std::string &amp; path)
            ^
  VideoFile.hpp:15:10: error: with ‘bool VideoFile::fileExists(const string&amp;)’
       bool fileExists(const std::string &amp; path);
  </code></pre>
  
  <p>However, I do not see how that error makes sense, because I have only function declaration which I directly copied and pasted when writing the definition.</p>
  
  <pre><code>class VideoFile
  {
  private:
      std::string filePath;
      bool fileExists(const std::string &amp; path);
  
  public:
  
      VideoFile(const std::string &amp; path)
          :filePath(path)
      {
          filePath = StringMethods::trim(path);
          if (!fileExists(filePath))
              throw std::runtime_error("The file: " + filePath + " was not accessible");
      }
  
      ~VideoFile() 
      {
  
      }
  
      bool fileExists(const std::string &amp; path)
      {
          std::ifstream file(path);
          return file.good();
      }
  };
  </code></pre>