class String { public: operator const char*() const; String(); String(char); private: friend String operator+ (const String& str1, const String& str2); friend String operator+ (const String& str1, const char* str2); friend String operator+ (const char* str1, const String& str2); }; void testPlusRegOfft () { String inString; regmatch_t pm[2]; strlen(inString + pm[1].rm_so); // typedef int regoff_t GoStringTest.cpp: In member function `void GoStringTest::testPlusRegOfft()': GoStringTest.cpp:59: ambiguous overload for `GoStringTest::String& + regoff_t&' operator GoStringTest.cpp:59: candidates are: operator+(const char*, int) GoStringTest.cpp:47: GoStringTest::String operator+(const GoStringTest::String&, const GoStringTest::String&) GoStringTest.cpp:48: GoStringTest::String operator+(const GoStringTest::String&, const char*) GoStringTest.cpp:49: GoStringTest::String operator+(const char*, const GoStringTest::String&) GoStringTest.cpp:49: GoStringTest::String operator+(const char*, const GoStringTest::String&) GoStringTest.cpp:48: GoStringTest::String operator+(const GoStringTest::String&, const char*) GoStringTest.cpp:47: GoStringTest::String operator+(const GoStringTest::String&, const GoStringTest::String&) } // what the heck?!