boost::shared_ptr::shared_ptr(const boost::shared_ptr&)' is implicitly declared as deleted

后端 未结 1 1849
慢半拍i
慢半拍i 2020-12-08 22:41
#include 
#include 
#include 
using namespace std;

struct Node
{
    Node(int data, boost::         


        
相关标签:
1条回答
  • 2020-12-08 22:57

    This is a bug in older versions of boost::shared_ptr that makes it incompatible with C++11 compilers.

    The final C++11 standard says that declaring a move constructor or move assignment operator prevents the implicit definition of a copy constructor, but older versions of boost::shared_ptr do not respect that rule and assume that a copy constructor will be implicitly defined.

    You either need to upgrade to Boost version 1.48 or later, or edit the Boost headers to add this to shared_ptr:

    shared_ptr(const shared_ptr&) = default;
    
    0 讨论(0)
提交回复
热议问题