Index: boost/spirit/repository/home/qi/directive/distinct.hpp =================================================================== --- boost/spirit/repository/home/qi/directive/distinct.hpp (revision 82841) +++ boost/spirit/repository/home/qi/directive/distinct.hpp (working copy) @@ -64,9 +64,9 @@ : spirit::qi::unary_parser > { template - struct attribute - : traits::attribute_of - {}; + struct attribute : traits::attribute_of + { + }; distinct_parser(Subject const& subject, Tail const& tail) : subject(subject), tail(tail) {} @@ -137,6 +137,12 @@ struct has_semantic_action< repository::qi::distinct_parser > : unary_has_semantic_action {}; + + template + struct handles_container< repository::qi::distinct_parser + , Attribute, Context, Iterator> + : handles_container {}; }}} #endif Index: libs/spirit/repository/test/qi/distinct.cpp =================================================================== --- libs/spirit/repository/test/qi/distinct.cpp (revision 82841) +++ libs/spirit/repository/test/qi/distinct.cpp (working copy) @@ -96,6 +96,19 @@ BOOST_TEST(!test("descriptionident", r, space)); } + { + using namespace boost::spirit::ascii; + namespace repo=boost::spirit::repository; + boost::spirit::qi::rule string_keyword; + string_keyword %= '+' >> (repo::qi::distinct("0-9a-zA-Z_")[string("ALPHA")] | + repo::qi::distinct("0-9a-zA-Z_")[string("BETA")]); + + std::string r1; + BOOST_TEST(test_attr("+ BETA",string_keyword,r1,space)); + BOOST_TEST(r1.compare("BETA")==0); + BOOST_TEST(!test_attr("+ BETAA",string_keyword,r1,space)); + + } return boost::report_errors(); }