Is there a range class in C++11 for use with range based for loops?
问题 I found myself writing this just a bit ago: template <long int T_begin, long int T_end> class range_class { public: class iterator { friend class range_class; public: long int operator *() const { return i_; } const iterator &operator ++() { ++i_; return *this; } iterator operator ++(int) { iterator copy(*this); ++i_; return copy; } bool operator ==(const iterator &other) const { return i_ == other.i_; } bool operator !=(const iterator &other) const { return i_ != other.i_; } protected: