The first argument to qi::parse is a non-const reference (which fails on the temporary you're passing in). 
Try:

  std::string::iterator ii = str.begin(); 
  boost::spirit::qi::parse(ii, str.end(),
           raw[+~string(delim)] % lit(delim), result);


Spirit uses the first parameter to return how far it got in the parsing of your string. 

hth,
 Brian

On 12 February 2010 05:53, Matthias Vallentin <vallentin@icsi.berkeley.edu> wrote:
On Thu, Feb 11, 2010 at 03:22:53PM -0700, OvermindDL1 wrote:
>     std::string result;
>     parse(str.begin(),str.end(), raw[+~char_(delim)]%lit(delim), result);

This fails in the first argument of qi::parse:

   using boost::spirit::qi::lit;
   using boost::spirit::qi::raw;
   using boost::spirit::qi::string;

   std::string str("foo---bar---baz");
   std::string delim("---");
   std::string result;
   boost::spirit::qi::parse(str.begin(), str.end(),
           raw[+~string(delim)] % lit(delim), result);

Any ideas why?

  Matthias
--
Matthias Vallentin
vallentin@icsi.berkeley.edu
http://www.icir.org/matthias
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users