Last active
July 12, 2017 20:55
-
-
Save stryku/d950e9bd2982b8d880fd2d5196956c60 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace details | |
| { | |
| template <typename T> | |
| constexpr auto canCallStdString = !std::is_same_v<T, bool> && | |
| (std::is_integral_v<T> || | |
| std::is_unsigned_v<T> || | |
| std::is_floating_point_v<T>); | |
| } | |
| template <typename T> | |
| std::enable_if_t<details::canCallStdString<T>, std::string> | |
| toString(const T& value) | |
| { | |
| return std::to_string(value); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment