Use sprout's limits instead of std's and remove unneeded make_unsigned.

I'm not sure what it was supposed to be, maybe a customization point
or something, but after the fix for counting the digits correctly I
removed the only usage of make_unsigned, so I could also get rid of
its implementation. Sweet~
This commit is contained in:
King_DuckZ 2017-04-25 09:33:27 +01:00
parent c3dee50e5b
commit f6bddac63d
3 changed files with 26 additions and 32 deletions

View file

@ -80,7 +80,14 @@ TEST_CASE ("Check string to int conversions", "[s2i][lexical_cast]") {
TEST_CASE ("Check int to string conversions", "[i2s][lexical_cast]") {
using std::string;
using dhandy::lexical_cast;
using dhandy::tags::bin;
CHECK(lexical_cast<string>(1) == "1");
CHECK(lexical_cast<string>(static_cast<uint16_t>(0xFFFF)) == "65535");
CHECK(lexical_cast<string>(static_cast<long long>(0xFFFF)) == "65535");
CHECK((lexical_cast<string, bin>(static_cast<uint16_t>(0xFFFF)) == "1111111111111111"));
CHECK((lexical_cast<string, bin>(static_cast<int16_t>(0x7FFF)) == "111111111111111"));
CHECK((lexical_cast<string, bin>(static_cast<long>(0x0)) == "0"));
CHECK((lexical_cast<string, bin>(static_cast<long>(0x1)) == "1"));
}