|
|
@ -55,8 +55,14 @@ template<int N> struct expand_snprintf {
|
|
|
|
template<typename Tuple, typename... Args> static int call(char *s, size_t maxlen, const char *format, const Tuple& tuple, const Args&... args) {
|
|
|
|
template<typename Tuple, typename... Args> static int call(char *s, size_t maxlen, const char *format, const Tuple& tuple, const Args&... args) {
|
|
|
|
return expand_snprintf<N-1>::call(s, maxlen, format, tuple, sprintf_cast(std::get<N-1>(tuple)), args...); }};
|
|
|
|
return expand_snprintf<N-1>::call(s, maxlen, format, tuple, sprintf_cast(std::get<N-1>(tuple)), args...); }};
|
|
|
|
template<> struct expand_snprintf<0> {
|
|
|
|
template<> struct expand_snprintf<0> {
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
template<typename Tuple, typename... Args> static int call(char *s, size_t maxlen, const char *format, const Tuple& tuple, const Args&... args) {
|
|
|
|
template<typename Tuple, typename... Args> static int call(char *s, size_t maxlen, const char *format, const Tuple& tuple, const Args&... args) {
|
|
|
|
return snprintf(s, maxlen, format, args...); }};
|
|
|
|
return _snprintf(s, maxlen, format, args...); }
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
template<typename Tuple, typename... Args> static int call(char *s, size_t maxlen, const char *format, const Tuple& tuple, const Args&... args) {
|
|
|
|
|
|
|
|
return snprintf(s, maxlen, format, args...); }
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Improved snprintf that accepts std::string and other types
|
|
|
|
// Improved snprintf that accepts std::string and other types
|
|
|
|
template<typename... Args>
|
|
|
|
template<typename... Args>
|
|
|
|