Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 30, 2010, 7:34:07 PM (14 years ago)
Author:
rgrieder
Message:

operator=() should not return constant references.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/SmartPtr.h

    r6417 r7268  
    3636#include <cassert>
    3737
     38#include "Identifier.h"
    3839#include "OrxonoxClass.h"
    3940#include "WeakPtr.h"
     
    8586            }
    8687
    87             inline const SmartPtr& operator=(int)
     88            inline SmartPtr& operator=(int)
    8889            {
    8990                SmartPtr(0).swap(*this);
     
    9192            }
    9293
    93             inline const SmartPtr& operator=(T* pointer)
     94            inline SmartPtr& operator=(T* pointer)
    9495            {
    9596                SmartPtr(pointer).swap(*this);
     
    9798            }
    9899
    99             inline const SmartPtr& operator=(const SmartPtr& other)
     100            inline SmartPtr& operator=(const SmartPtr& other)
    100101            {
    101102                SmartPtr(other).swap(*this);
     
    104105
    105106            template <class O>
    106             inline const SmartPtr& operator=(const SmartPtr<O>& other)
     107            inline SmartPtr& operator=(const SmartPtr<O>& other)
    107108            {
    108109                SmartPtr(other).swap(*this);
     
    111112
    112113            template <class O>
    113             inline const SmartPtr& operator=(const WeakPtr<O>& other)
     114            inline SmartPtr& operator=(const WeakPtr<O>& other)
    114115            {
    115116                SmartPtr(other).swap(*this);
     
    194195    SmartPtr<T> dynamic_pointer_cast(const SmartPtr<U>& p)
    195196    {
    196         return dynamic_cast<T*>(p.get());
     197        return orxonox_cast<T*>(p.get());
    197198    }
    198199}
Note: See TracChangeset for help on using the changeset viewer.