Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. std::string xxx_to_bin(const T& value)
  2. {
  3. const std::bitset<std::numeric_limits<T>::digits + 1> bs(value);
  4. const std::string s(bs.to_string());
  5. const std::string::size_type pos(s.find_first_not_of('0'));
  6. return pos == std::string::npos ? "0" : s.substr(pos);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement