aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-05-10 14:15:01 +0100
committerGravatar Sadie Powell2021-05-10 14:15:01 +0100
commitb42fa13259722e8be50ee3aeb177a66897dd6238 (patch)
tree0823daf8cdcc3c50935ca60c645ea7addcc02584 /include
parentAdd a new map-based method for building link data. (diff)
Fix the to_string implementation of ConvToStr.
I have no idea how I didn't notice this bug when it was originally written.
Diffstat (limited to 'include')
-rw-r--r--include/convto.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/convto.h b/include/convto.h
index cb8e1f369..32492efbb 100644
--- a/include/convto.h
+++ b/include/convto.h
@@ -72,7 +72,7 @@ inline std::string ConvToStr(const bool in)
* @param in The value to convert.
*/
template<typename Stringable>
-inline std::string func(const Stringable& in)
+inline std::enable_if_t<std::is_arithmetic_v<Stringable>, std::string> ConvToStr(const Stringable& in)
{
return std::to_string(in);
}
@@ -81,7 +81,7 @@ inline std::string func(const Stringable& in)
* @param in The value to convert.
*/
template <class T>
-inline std::string ConvToStr(const T& in)
+inline std::enable_if_t<!std::is_arithmetic_v<T>, std::string> ConvToStr(const T& in)
{
std::stringstream tmp;
if (!(tmp << in))