Nullary `Formatter` to suppress “comparison of unsigned expression >= 0 is always true” warning

master
yvt 2014-03-31 20:53:26 +09:00
parent 453f4a7d4f
commit f4bda2df67
2 changed files with 13 additions and 1 deletions

BIN
Resources/Maps/Title.vxl Normal file

Binary file not shown.

View File

@ -209,7 +209,19 @@ namespace spades {
}
};
template<>
class Formatter<0> {
const char *fmt;
public:
Formatter(const char *fmt):fmt(fmt) {
if(strchr(fmt, '{')) {
SPRaise("Malformed format string (using non-existent parameter. no parameter provided): %s", fmt);
}
}
std::string Format() {
return fmt;
}
};
template<class ...T>
std::string Format(const char *str, T... args) {