Is this code snippet portable?
definition:
#define log(...) std::cout << __FILE__ << "[" << __LINE__ << "]:" \
<< string_format(__VA_ARGS__) \
<< std::endl << std::flush
usage:
log("i = %d", i);
and string_format is sprintf that outputs a std::string taken from https://stackoverflow.com/a/8098080/624074 It works with my gcc 4.6.3 here but I don't want to have compilation issues later with other compilers.