Commit 77251c5d authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'Boost_range_support' into 'master'

Boost range support (Thanks to Bastian Pranzas for the patch)

See merge request !135
parents ee809a54 fba2f98c
...@@ -1123,6 +1123,9 @@ public: ...@@ -1123,6 +1123,9 @@ public:
ITER_TYPE (CONTAINER_TYPE::*end_fn)() const> ITER_TYPE (CONTAINER_TYPE::*end_fn)() const>
class EntityRange { class EntityRange {
public: public:
typedef ITER_TYPE iterator;
typedef ITER_TYPE const_iterator;
EntityRange(CONTAINER_TYPE &container) : container_(container) {} EntityRange(CONTAINER_TYPE &container) : container_(container) {}
ITER_TYPE begin() const { return (container_.*begin_fn)(); } ITER_TYPE begin() const { return (container_.*begin_fn)(); }
ITER_TYPE end() const { return (container_.*end_fn)(); } ITER_TYPE end() const { return (container_.*end_fn)(); }
...@@ -1184,12 +1187,15 @@ public: ...@@ -1184,12 +1187,15 @@ public:
ITER_TYPE (CONTAINER_TYPE::*end_fn)(CENTER_ENTITY_TYPE) const> ITER_TYPE (CONTAINER_TYPE::*end_fn)(CENTER_ENTITY_TYPE) const>
class CirculatorRange { class CirculatorRange {
public: public:
typedef ITER_TYPE iterator;
typedef ITER_TYPE const_iterator;
CirculatorRange( CirculatorRange(
const CONTAINER_TYPE &container, const CONTAINER_TYPE &container,
CENTER_ENTITY_TYPE center) : CENTER_ENTITY_TYPE center) :
container_(container), center_(center) {} container_(container), center_(center) {}
ITER_TYPE begin() { return (container_.*begin_fn)(center_); } ITER_TYPE begin() const { return (container_.*begin_fn)(center_); }
ITER_TYPE end() { return (container_.*end_fn)(center_); } ITER_TYPE end() const { return (container_.*end_fn)(center_); }
private: private:
const CONTAINER_TYPE &container_; const CONTAINER_TYPE &container_;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment