tcbrindle / NanoRange

Range-based goodness for C++17

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typos in insert_iterator?

eigenwhat opened this issue · comments

Spotted a few things when trying to use range algorithms with a std::map. I'm guessing they're just copy/paste errors from being based off back_insert_iterator? ;)

This should be using insert and not push_back:

insert_iterator& operator=(iter_value_t<Container>&& value)
{
cont_->push_back(it_, std::move(value));
++it_;
return *this;
}

Missing the iterator argument and constructing the wrong type:

insert_iterator<Container> inserter(Container& x)
{
return back_insert_iterator<Container>(x);
}

Ooops, yes, definite typos here, thanks for the notification