Skip to content

Commit a6c67ff

Browse files
committed
sliding_window iter inherits from std::iterator
1 parent ea81df3 commit a6c67ff

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

sliding_window.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,13 @@ namespace iter {
3535
window_size{win_sz}
3636
{ }
3737

38+
using DerefVec = std::deque<collection_item_type<Container>>;
3839
public:
3940

40-
class Iterator {
41+
class Iterator
42+
: public std::iterator<std::input_iterator_tag, DerefVec>
43+
{
4144
private:
42-
// TODO move defs outside and subclass std::iterator
43-
using OpDerefElemType = collection_item_type<Container>;
44-
using DerefVec = std::deque<OpDerefElemType>;
45-
4645
iterator_type<Container> sub_iter;
4746
DerefVec window;
4847

0 commit comments

Comments
 (0)