Add more unsigned si_string overloads.
This should fix compilation on systems where size_t != unsigned int.
This commit is contained in:
parent
ce2a23f2e2
commit
72bf610adb
2 changed files with 15 additions and 1 deletions
|
@ -352,10 +352,16 @@ std::string si_string_impl(T input, bool base2, std::string unit) {
|
|||
|
||||
return si_string_impl2(input, base2, unit);
|
||||
}
|
||||
// Specialisation for unsigned as the template causes warnings otherwise
|
||||
// Specialisation for unsigned types as the template causes warnings otherwise
|
||||
template <> std::string si_string_impl(unsigned input, bool base2, std::string unit) {
|
||||
return si_string_impl2(input, base2, unit);
|
||||
}
|
||||
template <> std::string si_string_impl(unsigned long input, bool base2, std::string unit) {
|
||||
return si_string_impl2(input, base2, unit);
|
||||
}
|
||||
template <> std::string si_string_impl(unsigned long long input, bool base2, std::string unit) {
|
||||
return si_string_impl2(input, base2, unit);
|
||||
}
|
||||
// Public functions
|
||||
std::string si_string(double input, bool base2, std::string unit) {
|
||||
return si_string_impl(input, base2, unit);
|
||||
|
@ -369,9 +375,15 @@ std::string si_string(unsigned input, bool base2, std::string unit) {
|
|||
std::string si_string(long input, bool base2, std::string unit) {
|
||||
return si_string_impl(input, base2, unit);
|
||||
}
|
||||
std::string si_string(unsigned long input, bool base2, std::string unit) {
|
||||
return si_string_impl(input, base2, unit);
|
||||
}
|
||||
std::string si_string(long long input, bool base2, std::string unit) {
|
||||
return si_string_impl(input, base2, unit);
|
||||
}
|
||||
std::string si_string(unsigned long long input, bool base2, std::string unit) {
|
||||
return si_string_impl(input, base2, unit);
|
||||
}
|
||||
std::string si_string(long double input, bool base2, std::string unit) {
|
||||
return si_string_impl(input, base2, unit);
|
||||
}
|
||||
|
|
|
@ -150,7 +150,9 @@ std::string si_string(int input, bool base2=true, std::string unit="B");
|
|||
std::string si_string(unsigned input, bool base2=true, std::string unit="B");
|
||||
/* Some extra-long versions */
|
||||
std::string si_string(long input, bool base2=true, std::string unit="B");
|
||||
std::string si_string(unsigned long input, bool base2=true, std::string unit="B");
|
||||
std::string si_string(long long input, bool base2=true, std::string unit="B");
|
||||
std::string si_string(unsigned long long input, bool base2=true, std::string unit="B");
|
||||
std::string si_string(long double input, bool base2=true, std::string unit="B");
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue