unique_ptr - major improvement?

前端 未结 5 1421
盖世英雄少女心
盖世英雄少女心 2021-02-01 19:41

In the actual C++ standard, creating collections satisfying following rules is hard if not impossible:

  1. exception safety,
  2. cheap internal operations (in act
5条回答
  •  余生分开走
    2021-02-01 20:02

    I agree entirely. There's at last a natural way of handling heap allocated objects.

    In answer to:

    I am not sure, but it looks like this allows to move groups of unique_ptrs by using memmove() like operations,

    there was a proposal to allow this, but it hasn't made it into the C++11 Standard.

提交回复
热议问题