Current version

Feb 2, 2012 10:53 AM
#include <boost/spirit/include/qi.hpp>

#include <iostream>
#include <string>

int main()
{
    using namespace boost::spirit::qi;

    auto comment_p = "/*" >> *(char_ - "*/") >> "*/";

    std::string str = "/*This is a comment*/";
    auto iter = str.begin();
    auto ok = parse(iter, str.end(), comment_p);

    return !(ok && iter == str.end());
}
 

Message history

Feb 2, 2012 10:53 AM
said: #include <boost/spirit/include/qi.hpp> #include <iostream> #include <string> int main() { using namespace boost::spirit::qi; auto comment_p = "/*" >> *(char_ - "*/") >> "*/"; std::string str = "/*This is a comment*/"; auto iter = str.begin(); auto ok = parse(iter, str.end(), comment_p); return !(ok && iter == str.end()); }