Mike Wahler wrote:"Joe Laughlin" <Jo***************@boeing.com> wrote in
message news:I6********@news.boeing.com... <snip>Joe Laughlin wrote:
std::back_insert_iterator<std::string>::operator=( const
std::back_insert_iterator<std::string>&)
'back_insert_iterator' requires that the container type
specified by its template argument defines members
'push_back()' and 'value_type'. 'std::string' defines the
latter, but not the former.
IOW you cannot use 'back_insert_iterator' with a
'std::string'. ('std::string', while sharing much
commonality with them, isn't strictly a 'container').
-Mike
Argh.
From "Accelerated C++", pg 121:
"back_inserter(c)
Yields an iterator on the container c that appends
elements to c. The container must support push_back,
which the list, vector, and the string types all do."
Was the book wrong? Or am I reading it wrong?