Construct-in-place an unmoveable object in a map

后端 未结 3 979
清酒与你
清酒与你 2021-01-18 14:36

I\'m trying to construct an object in a map that contains an atomic, so it can neither be copied nor moved AFAICT.

My reading of C++ reference is that map empl

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-18 15:16

    The simplest solution is to use operator[] to construct the value inside the map. Then you can assign a value (or operate on it as needed).

提交回复
热议问题