//C++ Includes #include #include //Boost Includes #include #include #include #include #include #include int main(int argc, char * argv[]) { std::string const& s = std::string("127.0.0.1:30045"); boost::char_separator seperator(":"); boost::tokenizer< boost::char_separator > tokens(s, seperator); namespace phx = boost::phoenix; std::vector string_tokens; phx::for_each(phx::ref(tokens), phx::lambda [ phx::push_back(phx::ref(string_tokens), phx::arg_names::arg1) ] ); //The follow is what is expected. //string_tokens[0] == "127.0.0.1" //string_tokens[1] == "30045" return 0; }