2012-05-13から1日間の記事一覧

Boost.Xpressive でセマンティックアクション

こんなことが出来るみたい。 [ソース] #include <boost/xpressive/xpressive.hpp> #include <boost/xpressive/regex_actions.hpp> #include <string> int main(){ namespace x = boost::xpressive; using x::_; std::string result; x::sregex regex = "(" >> ((x::s1 = -*_)[x::ref(result) = x::s1]) >> ")"; std::string const source</string></boost/xpressive/regex_actions.hpp></boost/xpressive/xpressive.hpp>…