diff --git a/CHANGELOG.md b/CHANGELOG.md index 78a70ef5..abf642bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Version 231: * Doc section names are stable * Add missing include +* Constrain to_static_string to integers -------------------------------------------------------------------------------- diff --git a/include/boost/beast/core/impl/static_string.hpp b/include/boost/beast/core/impl/static_string.hpp index 3fcfce83..c668b837 100644 --- a/include/boost/beast/core/impl/static_string.hpp +++ b/include/boost/beast/core/impl/static_string.hpp @@ -617,7 +617,7 @@ to_static_string(Integer x, std::false_type) } // detail -template +template static_string to_static_string(Integer x) { diff --git a/include/boost/beast/core/static_string.hpp b/include/boost/beast/core/static_string.hpp index 9227fa15..fc60a72e 100644 --- a/include/boost/beast/core/static_string.hpp +++ b/include/boost/beast/core/static_string.hpp @@ -1097,7 +1097,13 @@ operator<<(std::basic_ostream& os, maximum size large enough to hold the longest possible decimal representation of any integer of the given type. */ -template +template< + class Integer +#ifndef BOOST_BEAST_DOXYGEN + ,class = typename std::enable_if< + std::is_integral::value>::type +#endif +> static_string to_static_string(Integer x);