fix VC6 compile: even templated functions can't differ by only return value. Move return value to a reference parameter
This commit is contained in:
@@ -93,8 +93,8 @@ static const RString EMPTY_STRING;
|
||||
return (X)i; \
|
||||
return (X)(i+1); /*invalid*/ \
|
||||
} \
|
||||
template<> X StringTo<X>( const RString& s ) { return StringTo##X( s ); }
|
||||
template<class T> T StringTo( const RString& s );
|
||||
template<> void StringTo<X>( const RString& s, X &out ) { out = StringTo##X( s ); }
|
||||
template<class T> void StringTo( const RString& s, T &out );
|
||||
|
||||
#define LuaXToString(X) \
|
||||
LuaFunction( X##ToString, X##ToString( (X) IArg(1) ) );
|
||||
|
||||
@@ -219,7 +219,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template<class T> T StringTo( const RString& s );
|
||||
template<class T> void StringTo( const RString& s, T &out );
|
||||
template<class T>
|
||||
class ThemeMetricEnum : public ThemeMetric<RString>
|
||||
{
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
ThemeMetricEnum() : ThemeMetric<RString>() {}
|
||||
ThemeMetricEnum( const RString& sGroup, const RString& sName ) :
|
||||
ThemeMetric<RString>( sGroup, sName ) {}
|
||||
void Read() { ThemeMetric<RString>::Read(); m_Value = StringTo<T>(m_currentValue); }
|
||||
void Read() { ThemeMetric<RString>::Read(); StringTo<T>(m_currentValue,m_Value); }
|
||||
T GetValue() const { ASSERT( !m_sName.empty() && m_bIsLoaded ); return m_Value; }
|
||||
operator T () const { return GetValue(); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user