<div dir="ltr">It's very convenient to define a diagnostic syntax and use operator << to add parameters.<div><br></div><div>I'm currently doing some code generation jobs and want to use the grammar which is used in defining diagnostic errors, some sort like this: </div><div>StringStream << "class '%0' : %select{public|private}1 '%2'" << "Foo" << 0 << "Bar" << std::endl;</div><div><br></div><div>Is there any code to do this?</div></div>