Using operator[] on empty std::vector

前端 未结 7 925
迷失自我
迷失自我 2021-01-12 05:29

I was advised a while ago that is was common place to use std::vector as exception safe dynamic array in c++ rather than allocating raw arrays... for exampl

7条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-12 06:29

    See LWG issue 464. This is a known issue. C++0x (which is partially implemented by MSVC 2010) solves it by adding a .data() member.

提交回复
热议问题