diff options
| author | 2021-05-10 14:15:01 +0100 | |
|---|---|---|
| committer | 2021-05-10 14:15:01 +0100 | |
| commit | b42fa13259722e8be50ee3aeb177a66897dd6238 (patch) | |
| tree | 0823daf8cdcc3c50935ca60c645ea7addcc02584 /include | |
| parent | Add 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.h | 4 |
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)) |
