Disabling bounds checking for c++ vectors

前端 未结 8 2289
囚心锁ツ
囚心锁ツ 2021-02-08 06:09

With stl::vector:

vector v(1);
v[0]=1; // No bounds checking
v.at(0)=1; // Bounds checking

Is there a way to disable bounds checking

8条回答
  •  北荒
    北荒 (楼主)
    2021-02-08 06:43

    Maybe a better solution is to use [] and use checked implementation of the standard library for debug.

提交回复
热议问题