Parentheses in template parameters in Boost Spirit rules and grammars
Looking at this example for implementing a Spirit parser, something caught me out when I was trying to write something similar. The attribute template parameter of the grammar ( std::map<std::string, std::string>() ) and the signature template parameter of the rules (e.g. qi::rule<Iterator, std::string()> key, value ) contain parentheses. namespace qi = boost::spirit::qi; template <typename Iterator> struct keys_and_values : qi::grammar<Iterator, std::map<std::string, std::string>()> // <- parentheses here { keys_and_values() : keys_and_values::base_type(query) { query = pair >> *((qi::lit(';'