#include #include #include struct foo { std::string a, b; }; BOOST_FUSION_ADAPT_STRUCT( foo, (std::string, a) (std::string, b) ) int main() { using namespace boost::spirit::karma; using boost::phoenix::at_c; typedef rule, foo(), space_type> rule_t; rule_t r = +char_ << '(' << string << ')' | skip[string] << string ; foo f = {"a", "b"}; std::string s; generate_delimited(std::back_inserter(s), r, space, f); }