阅读背景:

将包含不可复制/可移动对象的struct添加到std :: map

来源:互联网 

I have this MCVE:

我有这个MCVE:

#include <atomic>
#include <map>
#include <string>

struct foo
{
    int intValue;
    std::atomic_bool bar;

    foo( int intValue ) : intValue( intValue ) {};
};

std::map<std::string, foo> myMap;

int main()
{
    myMap.emplace( "0",  1234 );
}
#include <atomi



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: