【发布时间】:2021-10-21 03:14:07
【问题描述】:
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:
所以这是我的代码,我搜索了整个互联网,但找不到资源/链接/等。关于为什么会出现这个错误。所以如果你们能说出这个错误的根本原因以及如何解决它,那将非常有帮助!谢谢!!
【问题讨论】:
-
你使用的是哪个编译器?
-
g++ 编译器。
-
实际上我读了这个答案,但没有任何直觉,因为我没有使用任何
const或constexpr -
Segment 和 Reactor 有复制构造函数吗?
标签: c++