mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 06:15:24 +02:00
Remove unused functions in impl/static_string.hpp
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ Version 264:
|
|||||||
* Handle overflow in max size calculation in `basic_dynamic_body`
|
* Handle overflow in max size calculation in `basic_dynamic_body`
|
||||||
* Fix unused variable warnings in tests
|
* Fix unused variable warnings in tests
|
||||||
* Fix missing initializer warning in `basic_fields`
|
* Fix missing initializer warning in `basic_fields`
|
||||||
|
* Remove unused functions in `impl/static_string.hpp`
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -558,64 +558,6 @@ assign_char(CharT, std::false_type) ->
|
|||||||
"max_size() == 0"});
|
"max_size() == 0"});
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
template<class Integer>
|
|
||||||
static_string<max_digits(sizeof(Integer))>
|
|
||||||
to_static_string(Integer x, std::true_type)
|
|
||||||
{
|
|
||||||
if(x == 0)
|
|
||||||
return {'0'};
|
|
||||||
static_string<detail::max_digits(
|
|
||||||
sizeof(Integer))> s;
|
|
||||||
if(x < 0)
|
|
||||||
{
|
|
||||||
x = -x;
|
|
||||||
char buf[max_digits(sizeof(x))];
|
|
||||||
char* p = buf;
|
|
||||||
for(;x > 0; x /= 10)
|
|
||||||
*p++ = "0123456789"[x % 10];
|
|
||||||
s.resize(1 + p - buf);
|
|
||||||
s[0] = '-';
|
|
||||||
auto d = &s[1];
|
|
||||||
while(p > buf)
|
|
||||||
*d++ = *--p;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char buf[max_digits(sizeof(x))];
|
|
||||||
char* p = buf;
|
|
||||||
for(;x > 0; x /= 10)
|
|
||||||
*p++ = "0123456789"[x % 10];
|
|
||||||
s.resize(p - buf);
|
|
||||||
auto d = &s[0];
|
|
||||||
while(p > buf)
|
|
||||||
*d++ = *--p;
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Integer>
|
|
||||||
static_string<max_digits(sizeof(Integer))>
|
|
||||||
to_static_string(Integer x, std::false_type)
|
|
||||||
{
|
|
||||||
if(x == 0)
|
|
||||||
return {'0'};
|
|
||||||
char buf[max_digits(sizeof(x))];
|
|
||||||
char* p = buf;
|
|
||||||
for(;x > 0; x /= 10)
|
|
||||||
*p++ = "0123456789"[x % 10];
|
|
||||||
static_string<detail::max_digits(
|
|
||||||
sizeof(Integer))> s;
|
|
||||||
s.resize(p - buf);
|
|
||||||
auto d = &s[0];
|
|
||||||
while(p > buf)
|
|
||||||
*d++ = *--p;
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // detail
|
|
||||||
|
|
||||||
template<class Integer, class>
|
template<class Integer, class>
|
||||||
static_string<detail::max_digits(sizeof(Integer))>
|
static_string<detail::max_digits(sizeof(Integer))>
|
||||||
to_static_string(Integer x)
|
to_static_string(Integer x)
|
||||||
|
Reference in New Issue
Block a user