Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::string xxx_to_bin(const T& value)
- {
- const std::bitset<std::numeric_limits<T>::digits + 1> bs(value);
- const std::string s(bs.to_string());
- const std::string::size_type pos(s.find_first_not_of('0'));
- return pos == std::string::npos ? "0" : s.substr(pos);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement