|
|
@@ -20,10 +20,12 @@ namespace iterator {
|
|
|
|
|
|
public:
|
|
|
proxy(Iter impl = {}) : impl_(impl) {}
|
|
|
+ template <typename... Args>
|
|
|
+ proxy(Args &&... args) : impl_(std::forward<Args>(args)...) {}
|
|
|
|
|
|
decltype(auto) dereference() const { return *impl_; }
|
|
|
void increment() { ++impl_; }
|
|
|
- bool equal_to(proxy const & other) const { return impl_ == other.impl_; }
|
|
|
+ bool equal_to(Self const & other) const { return impl_ == other.impl_; }
|
|
|
|
|
|
protected:
|
|
|
auto & impl() const { return impl_; }
|
|
|
@@ -36,10 +38,12 @@ namespace iterator {
|
|
|
|
|
|
public:
|
|
|
proxy(Iter impl = {}) : impl_(impl) {}
|
|
|
+ template <typename... Args>
|
|
|
+ proxy(Args &&... args) : impl_(std::forward<Args>(args)...) {}
|
|
|
|
|
|
decltype(auto) dereference() const { return *impl_; }
|
|
|
void increment() { ++impl_; }
|
|
|
- bool equal_to(proxy const & other) const { return impl_ == other.impl_; }
|
|
|
+ bool equal_to(Self const & other) const { return impl_ == other.impl_; }
|
|
|
|
|
|
protected:
|
|
|
auto & impl() const { return impl_; }
|
|
|
@@ -53,11 +57,13 @@ namespace iterator {
|
|
|
|
|
|
public:
|
|
|
proxy(Iter impl = {}) : impl_(impl) {}
|
|
|
+ template <typename... Args>
|
|
|
+ proxy(Args &&... args) : impl_(std::forward<Args>(args)...) {}
|
|
|
|
|
|
decltype(auto) dereference() const { return *impl_; }
|
|
|
void increment() { ++impl_; }
|
|
|
void decrement() { --impl_; }
|
|
|
- bool equal_to(proxy const & other) const { return impl_ == other.impl_; }
|
|
|
+ bool equal_to(Self const & other) const { return impl_ == other.impl_; }
|
|
|
|
|
|
protected:
|
|
|
auto & impl() const { return impl_; }
|
|
|
@@ -75,11 +81,16 @@ namespace iterator {
|
|
|
|
|
|
public:
|
|
|
proxy(Iter impl = {}) : impl_(impl) {}
|
|
|
+ template <typename... Args>
|
|
|
+ proxy(Args &&... args) : impl_(std::forward<Args>(args)...) {}
|
|
|
|
|
|
decltype(auto) dereference() const { return *impl_; }
|
|
|
void advance(difference_type off) { impl_ += off; }
|
|
|
- difference_type distance_to(proxy const & other) const {
|
|
|
- return impl_ - other.impl_;
|
|
|
+ // This shouldn't need to be implemented, but for some reason my traits
|
|
|
+ // are not correctly deducing here.
|
|
|
+ bool equal_to(Self const & other) const { return distance_to(other) == 0; }
|
|
|
+ difference_type distance_to(Self const & other) const {
|
|
|
+ return other.impl_ - impl_;
|
|
|
}
|
|
|
|
|
|
protected:
|