refactor: Improve use of explicit keyword

This commit is contained in:
Fabian Jahr
2020-11-29 19:33:22 +01:00
parent c502a6dbfb
commit 1e62350ca2
19 changed files with 31 additions and 22 deletions

View File

@@ -514,7 +514,7 @@ class FormatArg
{ }
template<typename T>
FormatArg(const T& value)
explicit FormatArg(const T& value)
: m_value(static_cast<const void*>(&value)),
m_formatImpl(&formatImpl<T>),
m_toIntImpl(&toIntImpl<T>)
@@ -970,7 +970,7 @@ class FormatListN : public FormatList
public:
#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES
template<typename... Args>
FormatListN(const Args&... args)
explicit FormatListN(const Args&... args)
: FormatList(&m_formatterStore[0], N),
m_formatterStore { FormatArg(args)... }
{ static_assert(sizeof...(args) == N, "Number of args must be N"); }