Should (in C++11) std::vector::resize(size_type) work for the default constructible value_type int[4]?

后端 未结 2 1790
遇见更好的自我
遇见更好的自我 2021-01-17 13:34

In C++11, there are two versions of std::vector::resize():

void resize( size_type count );
void resize( size_type count, const value_type& v         


        
2条回答
  •  清酒与你
    2021-01-17 14:04

    I found this discussion after I ran into a similar problem with resize() not working for a default-constructible type. It seems like the gcc vector implementation is incorrect.

    FYI, I filed a bug against gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64147

提交回复
热议问题