Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 22, 2009, 1:00:46 PM (15 years ago)
Author:
rgrieder
Message:

Adjusted orxonox_cast to support const pointers. References shall not be supported unless required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/core/Identifier.h

    r3332 r3333  
    458458
    459459            // Add pointer of type T to the map in the OrxonoxClass instance that enables "dynamic_casts"
    460             object->objectPointers_.push_back(std::make_pair(this->getClassID(), reinterpret_cast<void*>(object)));
     460            object->objectPointers_.push_back(std::make_pair(this->getClassID(), static_cast<void*>(object)));
    461461            return false;
    462462        }
     
    496496    */
    497497    template <class T, class U>
    498     FORCEINLINE T orxonox_cast(U* source)
     498    FORCEINLINE T orxonox_cast(U source)
    499499    {
    500500#ifdef ORXONOX_COMPILER_MSVC
    501         typedef Loki::TypeTraits<T>::PointeeType ClassType;
     501        typedef Loki::TypeTraits<typename Loki::TypeTraits<T>::PointeeType>::NonConstType ClassType;
    502502        return source->template getDerivedPointer<ClassType>(ClassIdentifier<ClassType>::getIdentifier()->getClassID());
    503503#else
Note: See TracChangeset for help on using the changeset viewer.