Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10979


Ignore:
Timestamp:
Dec 26, 2015, 12:05:20 AM (9 years ago)
Author:
landauf
Message:

gcc doesn't allow an explicit spezialization of a function-template inside a class-template. but we can use function overloading instead of templates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/command/Functor.h

    r10975 r10979  
    305305        protected:
    306306            /// Casts the object and registers as destruction listener if the object is a Destroyable.
    307             template<bool = std::is_base_of<Destroyable, O>::value>
    308             inline void registerObject(O* object)
    309                 { this->registerAsDestructionListener(static_cast<Destroyable*>(object)); }
    310 
    311             template<>
    312             inline void registerObject<false>(O* object) {}
     307            inline void registerObject(Destroyable* object)
     308                { this->registerAsDestructionListener(object); }
     309
     310            inline void registerObject(void* object) {}
    313311
    314312            /// Casts the object and unregisters as destruction listener if the object is a Destroyable.
    315             template<bool = std::is_base_of<Destroyable, O>::value>
    316             inline void unregisterObject(O* object)
    317                 { this->unregisterAsDestructionListener(static_cast<Destroyable*>(object)); }
    318 
    319             template<>
    320             inline void unregisterObject<false>(O* object) {}
     313            inline void unregisterObject(Destroyable* object)
     314                { this->unregisterAsDestructionListener(object); }
     315
     316            inline void unregisterObject(void* object) {}
    321317
    322318            /// Will be called by Destroyable::~Destroyable() if the stored object is a Destroyable and deleted and the Functor is in safe mode.
Note: See TracChangeset for help on using the changeset viewer.