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

Merge branch 'Boost_range_support' into 'master'

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

See merge request !135
parents ee809a54 fba2f98c
Pipeline #5353 passed with stage
in 42 minutes and 40 seconds
......@@ -1123,6 +1123,9 @@ public:
ITER_TYPE (CONTAINER_TYPE::*end_fn)() const>
class EntityRange {
public:
typedef ITER_TYPE iterator;
typedef ITER_TYPE const_iterator;
EntityRange(CONTAINER_TYPE &container) : container_(container) {}
ITER_TYPE begin() const { return (container_.*begin_fn)(); }
ITER_TYPE end() const { return (container_.*end_fn)(); }
......@@ -1184,12 +1187,15 @@ public:
ITER_TYPE (CONTAINER_TYPE::*end_fn)(CENTER_ENTITY_TYPE) const>
class CirculatorRange {
public:
typedef ITER_TYPE iterator;
typedef ITER_TYPE const_iterator;
CirculatorRange(
const CONTAINER_TYPE &container,
CENTER_ENTITY_TYPE center) :
container_(container), center_(center) {}
ITER_TYPE begin() { return (container_.*begin_fn)(center_); }
ITER_TYPE end() { return (container_.*end_fn)(center_); }
ITER_TYPE begin() const { return (container_.*begin_fn)(center_); }
ITER_TYPE end() const { return (container_.*end_fn)(center_); }
private:
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