C++ fixed length string class?

前端 未结 10 1119
遇见更好的自我
遇见更好的自我 2020-12-17 17:56

Is there anything like this in Standard C++ / STL? Ideally it should be constructed like

fstring s = fstring(10);

I need to sometimes cons

10条回答
  •  猫巷女王i
    2020-12-17 18:34

    With C++11, one can go for

    std::array s;
    

    Also std::string equivalent can always be constructed, when required

    std::string s2(std::begin(s), std::end(s));
    

提交回复
热议问题