Skip to content

Instantly share code, notes, and snippets.

@stryku
Last active July 12, 2017 20:55
Show Gist options
  • Select an option

  • Save stryku/289b18d6bcddeffc1672ccb18d32a80f to your computer and use it in GitHub Desktop.

Select an option

Save stryku/289b18d6bcddeffc1672ccb18d32a80f to your computer and use it in GitHub Desktop.
template <typename T>
std::enable_if_t<!std::is_same_v<T, bool> &&
(std::is_integral_v<T> ||
std::is_unsigned_v<T> ||
std::is_floating_point_v<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