Question: I am trying to connect back\_inserter\_iterator and cin, I understand that I could use copy with cin and back\_inserter, but wanted to know why cannot I perform the below

```
list<string> name;
back_insert_iterator<list<string>> ins_it(name);

while (cin >> ins_it);

```

The following is the error message I am getting:

> 
> error: cannot bind ‘std::istream {aka std::basic\_istream}’
>  lvalue to ‘std::basic\_istream&&’
> 
> 
> 

Thanks

Answer: 
Canonical ways to do it (if there is such a thing):

```
list<string> name{
    istream_iterator<string>{cin}, 
    istream_iterator<string>{}};

```

or:

```
list<string> name;
copy(istream_iterator<string>{cin}, istream_iterator<string>{},
    back_inserter(name));

```
The operator>>() is not an *insert* operator, it is an *extract* operator.
A back inserter object expects insertion, not an extraction.
Summarizing, there is just no operator>>(istream, inserter).