I have a class with several constructors and overloaded operators :
class Utf8String
{
public:
Utf8String();
explicit Utf8String( const char * sStr );
Utf8String( const char * sStrBeg, const char * sStrEnd );
Utf8String( const char * sStr, uint32_t nCpCount );
explicit Utf8String( const Utf8String & sStr );
explicit Utf8String( const Utf8String & sStr, uint32_t nStart = 0, uint32_t nCpCount = UINT32_MAX );
Utf8String( uint32_t nCpCount, uchar32_t cCodePoint );
explicit Utf8String( long int iVal );
explicit Utf8String( double fVal );
// More stuff
inline Utf8String operator + ( const char * sStr ) const
{
Utf8String sRes( *this ); // ERROR
return sRes += sStr;
}
inline operator const char * () const;
inline operator char * ();
inline operator long int () const;
inline operator double () const;
};
For some reason i'm getting an error :
Error 3 error C2668: 'core::Utf8String::Utf8String' : ambiguous call to overloaded function c:\xxx\utf8string.h 280
I tried added explicit keywords where it seemed to make sense. I also added explicit to all constructors, just to see what happens, but no matter what i do i'm getting this error and can' figure out why.
Do you have an idea ? Thank you.