On Mon, Jul 9, 2012 at 4:14 PM, Joel de Guzman <joel@boost-consulting.com> wrote:

Yes, it's a scoping issue. Please read up:

  http://tinyurl.com/brufnnw

I apologize for not seeing this sooner.   I got to the STL Algorithm page through the Lazy Functions page in the Starter Kit.  This in essence skipped over some of the documentation and it didn't occur to me that I was missing information.  


Please read up before you bash the thing ;-)

I didn't mean to sound harsh.  I gave a gut reaction about the needed syntax to accomplish what I considered a simple task.  I apologize if it sounded like an attack on the library.  That was not my intent. I really do appreciate all the hard work that goes into these libraries.

 
Actually, it could be simply:

  for_each(_1,
    lambda
    [
      push_back(ref(string_tokens), _1)
    ]

  )

Thank you for simplifying it even further.   I tried it and it compiles and works.  I did tried and reduce it even further.

for_each( ref(tokens),
  lambda
  [
    push_back(ref(string_tokens), _1)
  ]
)

This compiled but didn't work as intended.  Why is push_back able take a reference to string_tokens but for_each isn't able to take a reference to tokens?

Ryan