|
From: <mor...@us...> - 2010-09-14 10:14:45
|
Revision: 3863
http://ecell.svn.sourceforge.net/ecell/?rev=3863&view=rev
Author: moriyoshi
Date: 2010-09-14 10:14:39 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
* Fix weird bug caused by gcc's wrong function resolution.
Modified Paths:
--------------
ecell3/trunk/ecell/libecs/MethodProxy.hpp
Modified: ecell3/trunk/ecell/libecs/MethodProxy.hpp
===================================================================
--- ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-14 10:13:42 UTC (rev 3862)
+++ ecell3/trunk/ecell/libecs/MethodProxy.hpp 2010-09-14 10:14:39 UTC (rev 3863)
@@ -43,7 +43,7 @@
class MethodProxy<CLASS, RET>
{
private:
- typedef RET (* Invoker )( CLASS* );
+ typedef RET ( *Invoker )( CLASS* );
public:
RET operator()( CLASS* anObject ) const
@@ -110,7 +110,7 @@
class ObjectMethodProxy<RET>
{
private:
- typedef RET (* Invoker )( void* );
+ typedef RET ( *Invoker )( void* );
public:
RET operator()() const
@@ -121,13 +121,13 @@
template < typename T, RET (T::*TMethod)() >
static ObjectMethodProxy create( T* anObject )
{
- return ObjectMethodProxy( reinterpret_cast< Invoker >( &invoke< T, TMethod > ), anObject );
+ return ObjectMethodProxy( &invoke< T, TMethod >, anObject );
}
template < typename T, RET (T::*TMethod)() const >
static ObjectMethodProxy createConst( T const* anObject )
{
- return ObjectMethodProxy( reinterpret_cast< Invoker >( &invokeConst< T, TMethod > ), const_cast< T* >( anObject ) );
+ return ObjectMethodProxy( &invokeConst< T, TMethod >, const_cast< T* >( anObject ) );
}
inline bool operator==( ObjectMethodProxy const& that ) const
@@ -151,15 +151,15 @@
}
template < class T, RET (T::*TMethod)() >
- static RET invoke( T* anObject )
+ static RET invoke( void* anObject )
{
- return ( anObject->*TMethod )();
+ return ( reinterpret_cast< T* >( anObject )->*TMethod )();
}
template < class T, RET (T::*TMethod)() const >
- static RET invokeConst( T const* anObject )
+ static RET invokeConst( void* anObject )
{
- return ( anObject->*TMethod )();
+ return ( reinterpret_cast< T const* >( anObject )->*TMethod )();
}
private:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|