Changeset 10979 for code/branches/cpp11_v2/src/libraries
- Timestamp:
- Dec 26, 2015, 12:05:20 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/command/Functor.h
r10975 r10979 305 305 protected: 306 306 /// 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) {} 313 311 314 312 /// 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) {} 321 317 322 318 /// 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.