On 10/11/06, William Xue
First, I am a new user of boost. I wonder of the style of 'boost::format( format-string ) % arg1 % arg2 % ... % argN'. I think it, format(...), as a function, but it seems not function in C or C++ style.
variable arguments are very nasty in C++. Not only that, but the va_* macros do not allow for type safe generic programming (or type safety in general). The way it works is that boost::format("..."); returns an object which has the % operator defined. object % <anything> performs the operation and returns the same object. This allows for chaining. I'd assume the goal is to mirror python syntax. The problem with something like this: boost::format("...") % (a,b,c,d); is that C++ does not allow it. It is not syntactically correct.