Browse Source

GCC 4.4 compatibility: no lambda functions.

Vladimír Vondruš 14 years ago
parent
commit
c9ef8449c9
  1. 7
      src/SceneGraph/Object.h
  2. 2
      src/SceneGraph/Object.hpp

7
src/SceneGraph/Object.h

@ -215,6 +215,13 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
void setClean() override;
private:
/* GCC 4.4 doesn't support lambda functions */
#ifndef DOXYGEN_GENERATING_OUTPUT
struct DirtyCheck {
inline bool operator()(Object<Transformation>* o) const { return !o->isDirty(); }
};
#endif
Object<Transformation>* sceneObject() override;
const Object<Transformation>* sceneObject() const override;

2
src/SceneGraph/Object.hpp

@ -265,7 +265,7 @@ template<class Transformation> void Object<Transformation>::setClean(const std::
template<class Transformation> void Object<Transformation>::setClean(std::vector<Object<Transformation>*> objects) {
/* Remove all clean objects from the list */
auto firstClean = std::remove_if(objects.begin(), objects.end(), [](Object<Transformation>* o) { return !o->isDirty(); });
auto firstClean = std::remove_if(objects.begin(), objects.end(), DirtyCheck());
objects.erase(firstClean, objects.end());
/* No dirty objects left, done */

Loading…
Cancel
Save