Constrain to_static_string to integers

This commit is contained in:
Vinnie Falco committed 2019-03-12 13:44:48 -07:00
1 parent 30d1972aa2
commit cfbdce3e5c
3 files changed
+9 -2

No files matched your search

@@ -617,7 +617,7 @@ to_static_string(Integer x, std::false_type)
} // detail
template<class Integer>
template<class Integer, class>
static_string<detail::max_digits(sizeof(Integer))>
to_static_string(Integer x)
{
+7 -1
View File
@@ -1097,7 +1097,13 @@ operator<<(std::basic_ostream<CharT, Traits>& os,
maximum size large enough to hold the longest possible decimal
representation of any integer of the given type.
*/
template<class Integer>
template<
class Integer
#ifndef BOOST_BEAST_DOXYGEN
,class = typename std::enable_if<
std::is_integral<Integer>::value>::type
#endif
>
static_string<detail::max_digits(sizeof(Integer))>
to_static_string(Integer x);