: ) - Spirit V2, Boost V1.39 V1.40. , , Spirit V2.1 ( Boost V1.41), ( , ). Boost, , . ) boost:: lambda boost:: bind Spirit V2.x. , , , , , . boost:: phoenix. "" , . Phoenix, :
namespace qi = boost::spirit::qi;
namespace phoenix = boost::phoenix;
std::string physical, archived;
auto expr
= ( +char_(physicalPermitted) ) [phoenix::ref(physical) = qi::_1]
>> -(
':'
>> ( +char_(archivedPermitted) )[phoenix::ref(archived) = qi::_1]
)
;
, Spirit:
std::string physical;
boost::optional<std::string> archived;
qi::parse(begin, end,
+qi::char_(physicalPermitted) >> -(':' >> +qi::char_(archivedPermitted)),
physical, archived);
. . , . - Magic of Attributes on Spirit.
:
static_assert: yes static_assert, , . , . , , . (, , ++), , , .
Boost String Algorithms: , , . , Boost.Tokenizer( ":" ). Spirit , , , , . , , Spirit ( ).
Boost String, Boost Tokenizer . Spirit , . , /, Spirit, Boost Regex.