[Orxonox-commit 6322] r10979 - code/branches/cpp11_v2/src/libraries/core/command

landauf at orxonox.net landauf at orxonox.net
Sat Dec 26 00:05:20 CET 2015


Author: landauf
Date: 2015-12-26 00:05:20 +0100 (Sat, 26 Dec 2015)
New Revision: 10979

Modified:
   code/branches/cpp11_v2/src/libraries/core/command/Functor.h
Log:
gcc doesn't allow an explicit spezialization of a function-template inside a class-template. but we can use function overloading instead of templates.

Modified: code/branches/cpp11_v2/src/libraries/core/command/Functor.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/Functor.h	2015-12-25 22:27:35 UTC (rev 10978)
+++ code/branches/cpp11_v2/src/libraries/core/command/Functor.h	2015-12-25 23:05:20 UTC (rev 10979)
@@ -304,20 +304,16 @@
 
         protected:
             /// Casts the object and registers as destruction listener if the object is a Destroyable.
-            template<bool = std::is_base_of<Destroyable, O>::value>
-            inline void registerObject(O* object)
-                { this->registerAsDestructionListener(static_cast<Destroyable*>(object)); }
+            inline void registerObject(Destroyable* object)
+                { this->registerAsDestructionListener(object); }
 
-            template<>
-            inline void registerObject<false>(O* object) {}
+            inline void registerObject(void* object) {}
 
             /// Casts the object and unregisters as destruction listener if the object is a Destroyable.
-            template<bool = std::is_base_of<Destroyable, O>::value>
-            inline void unregisterObject(O* object)
-                { this->unregisterAsDestructionListener(static_cast<Destroyable*>(object)); }
+            inline void unregisterObject(Destroyable* object)
+                { this->unregisterAsDestructionListener(object); }
 
-            template<>
-            inline void unregisterObject<false>(O* object) {}
+            inline void unregisterObject(void* object) {}
 
             /// Will be called by Destroyable::~Destroyable() if the stored object is a Destroyable and deleted and the Functor is in safe mode.
             virtual inline void objectDeleted() override




More information about the Orxonox-commit mailing list