From 30e9778826d5513267cc3694fecd8e879e4d446e Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Tue, 14 Mar 2006 18:56:17 +0000 Subject: [PATCH] fix VC6 compile: even templated functions can't differ by only return value. Move return value to a reference parameter --- stepmania/src/EnumHelper.h | 4 ++-- stepmania/src/ThemeMetric.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stepmania/src/EnumHelper.h b/stepmania/src/EnumHelper.h index 1aeb03e72c..13a31c1628 100644 --- a/stepmania/src/EnumHelper.h +++ b/stepmania/src/EnumHelper.h @@ -93,8 +93,8 @@ static const RString EMPTY_STRING; return (X)i; \ return (X)(i+1); /*invalid*/ \ } \ - template<> X StringTo( const RString& s ) { return StringTo##X( s ); } -template T StringTo( const RString& s ); + template<> void StringTo( const RString& s, X &out ) { out = StringTo##X( s ); } +template void StringTo( const RString& s, T &out ); #define LuaXToString(X) \ LuaFunction( X##ToString, X##ToString( (X) IArg(1) ) ); diff --git a/stepmania/src/ThemeMetric.h b/stepmania/src/ThemeMetric.h index 9bfe9d795f..d4344bded0 100644 --- a/stepmania/src/ThemeMetric.h +++ b/stepmania/src/ThemeMetric.h @@ -219,7 +219,7 @@ public: } }; -template T StringTo( const RString& s ); +template void StringTo( const RString& s, T &out ); template class ThemeMetricEnum : public ThemeMetric { @@ -228,7 +228,7 @@ public: ThemeMetricEnum() : ThemeMetric() {} ThemeMetricEnum( const RString& sGroup, const RString& sName ) : ThemeMetric( sGroup, sName ) {} - void Read() { ThemeMetric::Read(); m_Value = StringTo(m_currentValue); } + void Read() { ThemeMetric::Read(); StringTo(m_currentValue,m_Value); } T GetValue() const { ASSERT( !m_sName.empty() && m_bIsLoaded ); return m_Value; } operator T () const { return GetValue(); } };