Skip to content

misleading name for two-parameter Foam::name()

  • currently accepts a printf-style format string. It should probably be renamed as format instead. Since this is reasonably infrequently used, I think that it should be relegated to the stringOps namespace as well. Eg,

    stringOps::format("fmt%d", 10);

In fact, probably want to make the whole thing templated:

template<class Primitive, class StringType=string>
StringType format(const char* fmt, const Primitive& val)

If desired, could have convenience static word::format as part of the word class, etc.

Might also consider with Args... forwarding.

Edited by Mark OLESEN