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:
Chris Danford
2006-03-14 18:56:17 +00:00
parent 3faa5ad4f2
commit 30e9778826
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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) ) );
+2 -2
View File
@@ -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(); }
};