Author: ashaposhnikov
Date: Sun Sep 10 20:45:56 2017
New Revision: 75822
URL:
http://svn.reactos.org/svn/reactos?rev=75822&view=rev
Log:
[ATL] CStringT fixes
- Added copy constructor and assignment from CSimpleStringT to CStringT
This fixed initialization while using `operator+` in GCC.
```CStringW s = a + b; ```
operator+ operators are defined for CSimpleStringT.
It worked in MSVC because it did implicit conversion of CSimpleStringT to PCXSTR which
called appropriate CStringT constructor.
GCC doesn't do such conversions and triggers an error.
- Unified `operator=(CStringT, PCXSTR)` with the rest
Modified:
branches/GSoC_2017/rapps/reactos/sdk/lib/atl/cstringt.h
Modified: branches/GSoC_2017/rapps/reactos/sdk/lib/atl/cstringt.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/sdk/lib…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/sdk/lib/atl/cstringt.h [iso-8859-1] (original)
+++ branches/GSoC_2017/rapps/reactos/sdk/lib/atl/cstringt.h [iso-8859-1] Sun Sep 10
20:45:56 2017
@@ -319,6 +319,11 @@
{
}
+ CStringT(_In_ const CThisSimpleString& strSrc) :
+ CThisSimpleString(strSrc)
+ {
+ }
+
template<class StringTraits_>
CStringT(_In_ const CStringT<YCHAR, StringTraits_> & strSrc) :
CThisSimpleString(StringTraits::GetDefaultManager())
@@ -404,6 +409,12 @@
return *this;
}
+ CStringT& operator=(_In_ const CThisSimpleString &strSrc)
+ {
+ CThisSimpleString::operator=(strSrc);
+ return *this;
+ }
+
friend bool operator==(const CStringT& str1, const CStringT& str2) throw()
{
return str1.Compare(str2) == 0;
@@ -417,7 +428,7 @@
friend bool operator==(const CStringT& str1, PCYSTR psz2) throw()
{
CStringT tmp(psz2, str1.GetManager());
- return tmp == str1;
+ return tmp.Compare(str1) == 0;
}
friend bool operator==(const CStringT& str1, XCHAR ch2) throw()