Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以用字符串重新初始化位集?我有一个像这样的简单类:
class Bits{ public: bitset<1024>b; };
是否有可能稍后我得到一个字符串并在代码中用字符串设置位(字符串长度为 1024,只有 1 和 0)?
Bits c; c.b.something(string);
是的,最简单的是:
b = bitset<1024>(some_string_form);