다른 스레드에 대한 내용은 copy or reference semantics for boost::spirt::qi::rule입니다. 부스트 1.42를 사용하고 있습니다.std :: list에 boost :: spirit :: qi :: rule을 저장하는 중
using boost::spirit::qi::phrase_parse;
typedef boost::spirit::qi::rule < std::string::const_iterator, boost::spirit::ascii::space_type > rule_type;
std::list <rule_type> ruleList;
std::string const s("abcdef");
std::string::const_iterator iter = s.begin(), end = s.end();
std::cout << typeid(char_).name() << std::endl;
ruleList.push_back(char_);
ruleList.push_back(*ruleList.back());
assert(phrase_parse(iter, s.end(), ruleList.back(), boost::spirit::ascii::space));
assert(iter == s.end());
이것은 STL 목록이나 양단 큐에 규칙을 저장하는 방법이 있나요으로 ...
Assertion `phrase_parse(iter, s.end(), ruleList.back(), traits::space())' failed.
Aborted (core dumped)
실패? (참고 문헌은 제거 될 때까지 사망하지 않습니다).