Fix ambiguous overload resolution
One operator+ for CBotString is enoughdev-time-step
parent
eeea31408b
commit
13f0159705
|
@ -397,7 +397,6 @@ public:
|
||||||
const CBotString& operator=(const CBotString& stringSrc);
|
const CBotString& operator=(const CBotString& stringSrc);
|
||||||
const CBotString& operator=(const char ch);
|
const CBotString& operator=(const char ch);
|
||||||
const CBotString& operator=(const char* pString);
|
const CBotString& operator=(const char* pString);
|
||||||
friend CBotString operator+(const CBotString& string, const char* lpsz);
|
|
||||||
CBotString operator+(const CBotString& str);
|
CBotString operator+(const CBotString& str);
|
||||||
|
|
||||||
const CBotString& operator+=(const char ch);
|
const CBotString& operator+=(const char ch);
|
||||||
|
|
|
@ -216,7 +216,7 @@ CBotFunction* CBotFunction::Compile(CBotToken* &p, CBotCStack* pStack, CBotFunct
|
||||||
|
|
||||||
if ( IsOfType(p, ID_NOT) )
|
if ( IsOfType(p, ID_NOT) )
|
||||||
{
|
{
|
||||||
CBotToken d("~" + p->GetString());
|
CBotToken d(CBotString("~") + p->GetString());
|
||||||
func->m_token = d;
|
func->m_token = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -337,13 +337,6 @@ const CBotString& CBotString::operator=(const CBotString& stringSrc)
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBotString operator+(const CBotString& string, const char * lpsz)
|
|
||||||
{
|
|
||||||
CBotString s(string);
|
|
||||||
s += lpsz;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
CBotString CBotString::operator+(const CBotString& stringSrc)
|
CBotString CBotString::operator+(const CBotString& stringSrc)
|
||||||
{
|
{
|
||||||
CBotString s(*this);
|
CBotString s(*this);
|
||||||
|
|
|
@ -1703,7 +1703,7 @@ void CBotVarClass::DecrementUse()
|
||||||
pThis->SetPointer(this);
|
pThis->SetPointer(this);
|
||||||
CBotVar* pResult = nullptr;
|
CBotVar* pResult = nullptr;
|
||||||
|
|
||||||
CBotString nom = "~" + m_pClass->GetName();
|
CBotString nom = CBotString("~") + m_pClass->GetName();
|
||||||
long ident = 0;
|
long ident = 0;
|
||||||
|
|
||||||
while ( pile->IsOk() && !m_pClass->ExecuteMethode(ident, nom, pThis, ppVars, pResult, pile, nullptr)) ; // waits for the end
|
while ( pile->IsOk() && !m_pClass->ExecuteMethode(ident, nom, pThis, ppVars, pResult, pile, nullptr)) ; // waits for the end
|
||||||
|
|
|
@ -277,9 +277,6 @@ TEST(CBotString_Test, operatorAdd)
|
||||||
botStr1 = botStr1 + botStr3;
|
botStr1 = botStr1 + botStr3;
|
||||||
EXPECT_STREQ(botStr1.CStr(), botStr4.CStr());
|
EXPECT_STREQ(botStr1.CStr(), botStr4.CStr());
|
||||||
|
|
||||||
botStr1 = "C" + botStr3;
|
|
||||||
EXPECT_STREQ(botStr1.CStr(), botStr4.CStr());
|
|
||||||
|
|
||||||
botStr1.Empty();
|
botStr1.Empty();
|
||||||
botStr1 = botStr2 + cStr1;
|
botStr1 = botStr2 + cStr1;
|
||||||
EXPECT_STREQ(botStr1.CStr(), botStr4.CStr());
|
EXPECT_STREQ(botStr1.CStr(), botStr4.CStr());
|
||||||
|
|
Loading…
Reference in New Issue