2
class Segment;
class Reactor;
class Client;
class Handler;

class SegmentInfo   
 64     {
 65     ▏   public:
 66     ▏   ▏   Segment segment;
 67     ▏   ▏   Reactor reactor;
 68     ▏   ▏   Client* client;
 69     ▏   ▏   queue<Handler*> pool;
 70 
 71     ▏   ▏   SegmentInfo(Segment _segment, int poolSize, Client* _client):
 72     ▏   ▏   ▏   segment(_segment), pool(poolSize), client(_client)
 73     ▏   ▏   {
 74 
 75     ▏   ▏   }
 76    };
error: use of deleted function ‘SegmentInfo::SegmentInfo(const SegmentInfo&)’

note: SegmentInfo::SegmentInfo(const SegmentInfo&)’ is implicitly deleted because the default definition would be ill-formed:


So here is my code and I searched all over internet but not able to find resource/link/etc. on why this error is coming. So if you people can tell the root cause of this error and how to solve it, it will be very helpful!! Thank you!!

rdx
  • 101
  • 1
  • 7

1 Answers1

2

My guess is that SegmentInfo has a member or inherits from someone with a deleted copy constructor. Note how this example gives you the same error:

struct A
{
    A(const A&) = delete;
    A(){}
};

struct B
{ 
    A a;
};

int main()
{
    B b;
    B b2 = b;
}
user14789259
  • 423
  • 2
  • 11