aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/string_tools.h
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-01-16 17:30:17 -0800
committerAlexander Blair <snipa@jagtech.io>2020-01-16 17:30:17 -0800
commitfe736070d290e640b3ecef6dbc71ef268f868bfe (patch)
treee466a27babcf415ad2a149065a1e2faee6f3c55a /contrib/epee/include/string_tools.h
parentMerge pull request #6119 (diff)
parentepee: fix peer ids being truncated on display (diff)
downloadmonero-fe736070d290e640b3ecef6dbc71ef268f868bfe.tar.xz
Merge pull request #6120
feef1c6a epee: fix peer ids being truncated on display (moneromooo-monero)
Diffstat (limited to 'contrib/epee/include/string_tools.h')
-rw-r--r--contrib/epee/include/string_tools.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h
index 1be5eb5e1..319c0121b 100644
--- a/contrib/epee/include/string_tools.h
+++ b/contrib/epee/include/string_tools.h
@@ -188,8 +188,10 @@ POP_WARNINGS
return boost::lexical_cast<std::string>(val);
}
//----------------------------------------------------------------------------
- inline std::string to_string_hex(uint32_t val)
+ template<typename T>
+ inline std::string to_string_hex(const T &val)
{
+ static_assert(std::is_arithmetic<T>::value, "only arithmetic types");
std::stringstream ss;
ss << std::hex << val;
std::string s;