Skip to content

Commit

Permalink
Update string.h
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Sep 11, 2024
1 parent 6f42e24 commit 1e0c422
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugify/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -1778,8 +1778,7 @@ namespace plg {
}

template<std::signed_integral Type, std::unsigned_integral UType = std::make_unsigned_t<Type>>
_PLUGIFY_ALWAYS_INLINE
constexpr inline string to_string(Type value) {
constexpr _PLUGIFY_ALWAYS_INLINE string to_string(Type value) {
const auto negative = value < 0;
const UType uvalue = negative ? static_cast<UType>(~value) + static_cast<UType>(1) : static_cast<UType>(value);
const auto length = to_chars_len(uvalue);
Expand All @@ -1789,8 +1788,7 @@ namespace plg {
}

template<std::unsigned_integral Type>
_PLUGIFY_ALWAYS_INLINE
constexpr inline string to_string(Type value) {
constexpr _PLUGIFY_ALWAYS_INLINE string to_string(Type value) {
string str(to_chars_len(value), '\0');
to_chars(&str[0], str.length(), value);
return str;
Expand Down

0 comments on commit 1e0c422

Please sign in to comment.