AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface

◆ SafePrintf() [1/2]

template<typename T , typename... Types>
void drama::SafePrintf ( std::ostream &  ostream,
const char format,
const T &  value,
Types...  args 
)

Safe formatted write to a stream.

Case with arguments.

This is probably slower then say fprintf(), and provides no way to influence the formatting. But in many cases its type safety is what really matters.

Deprecated:
Use the fmt::format library instead of this function. See DRAMA 2 String formatting for details on this formatting approach, but you can replace the use of this function by returning value of fmt::format() to the stream.
Parameters
ostreamThe stream to write to.
formatThe format string. Each % character is to be replaced by the corresponding argument. Note - only the % is needed and used, don't do for example "%d". To output a %, use "%%".
valueThe first argument.
argsArguments to the format. Any arbitrary types can be formatted as long as an overload of the << operator is available for that type.
Template Parameters
TThe type of the first argument.
Types...the remaining argument types.

References CreateRunDramaTask(), DramaTHROW, and SafePrintf().