Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 6, 2015, 2:51:14 PM (8 years ago)
Author:
landauf
Message:

no static functions anymore in ObjectList. you need to instantiate an ObjectList to use it.
this allows for prettier for-loop syntax when iterating over an ObjectList of a specific context: for (T* object : ObjectList<T>(context)) { … }

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/class/Identifier.h

    r10919 r10920  
    415415    void ClassIdentifier<T>::destroyObjects(Listable*)
    416416    {
    417         ObjectListBase* objectList = Context::getRootContext()->getObjectList(this);
    418         ObjectListElement<T>* begin = static_cast<ObjectListElement<T>*>(objectList->begin());
    419         ObjectListElement<T>* end = static_cast<ObjectListElement<T>*>(objectList->end());
    420         for (typename ObjectList<T>::iterator it = begin; it != end; )
     417        ObjectList<T> list(Context::getRootContext()->getObjectList(this));
     418        for (typename ObjectList<T>::iterator it = list.begin(); it != list.end(); )
    421419            this->destroyObject(*(it++));
    422420    }
Note: See TracChangeset for help on using the changeset viewer.