|
|
@ -167,7 +167,7 @@ namespace tinyformat { |
|
|
|
class format_error: public std::runtime_error |
|
|
|
class format_error: public std::runtime_error |
|
|
|
{ |
|
|
|
{ |
|
|
|
public: |
|
|
|
public: |
|
|
|
format_error(const std::string &what): std::runtime_error(what) { |
|
|
|
explicit format_error(const std::string &what): std::runtime_error(what) { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -498,7 +498,7 @@ class FormatArg |
|
|
|
FormatArg() {} |
|
|
|
FormatArg() {} |
|
|
|
|
|
|
|
|
|
|
|
template<typename T> |
|
|
|
template<typename T> |
|
|
|
FormatArg(const T& value) |
|
|
|
explicit FormatArg(const T& value) |
|
|
|
: m_value(static_cast<const void*>(&value)), |
|
|
|
: m_value(static_cast<const void*>(&value)), |
|
|
|
m_formatImpl(&formatImpl<T>), |
|
|
|
m_formatImpl(&formatImpl<T>), |
|
|
|
m_toIntImpl(&toIntImpl<T>) |
|
|
|
m_toIntImpl(&toIntImpl<T>) |
|
|
@ -867,7 +867,7 @@ class FormatListN : public FormatList |
|
|
|
public: |
|
|
|
public: |
|
|
|
#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES |
|
|
|
#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES |
|
|
|
template<typename... Args> |
|
|
|
template<typename... Args> |
|
|
|
FormatListN(const Args&... args) |
|
|
|
explicit FormatListN(const Args&... args) |
|
|
|
: FormatList(&m_formatterStore[0], N), |
|
|
|
: FormatList(&m_formatterStore[0], N), |
|
|
|
m_formatterStore { FormatArg(args)... } |
|
|
|
m_formatterStore { FormatArg(args)... } |
|
|
|
{ static_assert(sizeof...(args) == N, "Number of args must be N"); } |
|
|
|
{ static_assert(sizeof...(args) == N, "Number of args must be N"); } |
|
|
@ -876,7 +876,7 @@ class FormatListN : public FormatList |
|
|
|
# define TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR(n) \ |
|
|
|
# define TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR(n) \ |
|
|
|
\ |
|
|
|
\ |
|
|
|
template<TINYFORMAT_ARGTYPES(n)> \ |
|
|
|
template<TINYFORMAT_ARGTYPES(n)> \ |
|
|
|
FormatListN(TINYFORMAT_VARARGS(n)) \ |
|
|
|
explicit FormatListN(TINYFORMAT_VARARGS(n)) \ |
|
|
|
: FormatList(&m_formatterStore[0], n) \ |
|
|
|
: FormatList(&m_formatterStore[0], n) \ |
|
|
|
{ assert(n == N); init(0, TINYFORMAT_PASSARGS(n)); } \ |
|
|
|
{ assert(n == N); init(0, TINYFORMAT_PASSARGS(n)); } \ |
|
|
|
\ |
|
|
|
\ |
|
|
|