Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typos in insert_iterator? #108

Open
eigenwhat opened this issue Sep 15, 2020 · 1 comment
Open

Typos in insert_iterator? #108

eigenwhat opened this issue Sep 15, 2020 · 1 comment

Comments

@eigenwhat
Copy link

eigenwhat commented Sep 15, 2020

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);
}

@tcbrindle
Copy link
Owner

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

eigenwhat added a commit to eigenwhat/NanoRange that referenced this issue Nov 30, 2020
eigenwhat added a commit to eigenwhat/NanoRange that referenced this issue Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants