template<class T> std::string tostr(const std::bitset<T>& val) { return val.to_string<char,char_traits<char>,allocator<char> >(); };