FString fix for 32-bit architectures

This commit is contained in:
Markus Gans 2018-10-15 01:51:09 +02:00
parent de4be23a04
commit 4fac4627cd
2 changed files with 12 additions and 22 deletions

View File

@ -443,24 +443,6 @@ const FString& FString::operator >> (float& num)
return *this; return *this;
} }
//----------------------------------------------------------------------
wchar_t& FString::operator [] (std::size_t pos)
{
if ( pos >= length )
throw std::out_of_range(""); // Invalid index position
return string[pos];
}
//----------------------------------------------------------------------
const wchar_t& FString::operator [] (std::size_t pos) const
{
if ( pos >= length )
throw std::out_of_range(""); // Invalid index position
return string[pos];
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
const FString& FString::operator () () const FString& FString::operator () ()
{ {

View File

@ -137,8 +137,6 @@ class FString
wchar_t& operator [] (IndexT); wchar_t& operator [] (IndexT);
template <typename IndexT> template <typename IndexT>
const wchar_t& operator [] (IndexT) const; const wchar_t& operator [] (IndexT) const;
wchar_t& operator [] (std::size_t);
const wchar_t& operator [] (std::size_t) const;
const FString& operator () (); const FString& operator () ();
bool operator < (const FString&) const; bool operator < (const FString&) const;
@ -292,12 +290,22 @@ inline const char* FString::getClassName()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template <typename IndexT> template <typename IndexT>
inline wchar_t& FString::operator [] (IndexT pos) inline wchar_t& FString::operator [] (IndexT pos)
{ return string[std::size_t(pos)]; } {
if ( pos < 0 || pos >= IndexT(length) )
throw std::out_of_range(""); // Invalid index position
return string[std::size_t(pos)];
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template <typename IndexT> template <typename IndexT>
inline const wchar_t& FString::operator [] (IndexT pos) const inline const wchar_t& FString::operator [] (IndexT pos) const
{ return string[std::size_t(pos)]; } {
if ( pos < 0 || pos >= IndexT(length) )
throw std::out_of_range(""); // Invalid index position
return string[std::size_t(pos)];
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
template <class CharT> template <class CharT>