title: GoogleTest fails to use custom comparison operator
body: <p>I wanted to do simple tests on my Word struct in Google Test. To make the test code simpler and shorter I decided to write a comparison operator (even though I don't really need one) and just use <code>ASSERT_EQ</code>, as per <a href="https://github.com/google/googletest/blob/master/googletest/docs/primer.md#binary-comparison" rel="nofollow noreferrer">the primer</a>. Even though everything seems OK, I get a compiler error:</p>
  
  <pre><code>/* Word.h */
  namespace tgs {
  
  struct Word {
      //something here
      Word();
      virtual ~Word();
      bool operator== (Word&amp; rhs);
  };
  }
  
  /* Word.cpp */
  namespace tgs {
  bool Word::operator== (Word&amp; rhs){
    return true; //there are actual member comparisons here
  }
  }
  
  
  /* TextAreaShould_test.cc */
  TEST_F(TextAreaShould, DoSomething) {
    Word w1, w2;
  
    if(w1 == w2){ //compiles and runs ok
      0;
    }
    ASSERT_EQ(w1, w2); //produces following error
  }
  </code></pre>
  
  <p>compiler error:</p>
  
  <pre><code>[ 86%] Building CXX object CMakeFiles/tests/TextAreaShould.test.dir/tests/TextAreaShould_test.cc.o
  /usr/bin/c++    -I/home/nietaki/zpp/TheGameShow_build -I/home/nietaki/zpp/TheGameShow -I/home/nietaki/zpp/TheGameShow/google_mock/include -I/home/nietaki/zpp/TheGameShow/google_mock/gtest/include -I/usr/local/include   -o CMakeFiles/tests/TextAreaShould.test.dir/tests/TextAreaShould_test.cc.o -c /home/nietaki/zpp/TheGameShow/tests/TextAreaShould_test.cc
  In file included from /home/nietaki/zpp/TheGameShow/tests/TextAreaShould_test.cc:8:
  /home/nietaki/zpp/TheGameShow/google_mock/gtest/include/gtest/gtest.h: In function ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&amp;, const T2&amp;) [with T1 = tgs::Word, T2 = tgs::Word]’:
  /    home/nietaki/zpp/TheGameShow/google_mock/gtest/include/gtest/gtest.h:1363:   instantiated from ‘static testing::AssertionResult testing::internal::EqHelper&lt;lhs_is_null_literal&gt;::Compare(const char*, const char*, const T1&amp;, const T2&amp;) [with T1 = tgs::Word, T2 = tgs::Word, bool lhs_is_null_literal = false]’
  /home/nietaki/zpp/TheGameShow/tests/TextAreaShould_test.cc:112:   instantiated from here
  /home/nietaki/zpp/TheGameShow/google_mock/gtest/include/gtest/gtest.h:1326: error: no match for ‘operator==’ in ‘expected == actual’
  /home/nietaki/zpp/TheGameShow/renderer/textarea/Word.h:25: note: candidates are: bool tgs::Word::operator==(tgs::Word&amp;)
  </code></pre>
  
  <p>I also tried placing the comparison operator outside the class, not as a member, but it doesn't seem to make much of a difference. I tried to do everything according to the Primer, but perhaps something is wrong.</p>