chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.64k stars 5.14k forks source link

unique_ptr使用问题 #690

Closed cellphonef closed 1 year ago

cellphonef commented 1 year ago

如TcpServer中的acceptor_成员和TcpConneciton中的socket_以及channel_成员,都使用unique_ptr来管理,个人觉得可以直接使用对象即可,想问muduo使用unique_ptr来管理是出于什么原因?减少头文件的依赖吗?