boost::asio を使用する次のコードを見てください。
#include <boost/asio.hpp>
using boost::asio::ip::tcp;
class SocketTest
{
private:
boost::asio::io_service& mIOService;
tcp::acceptor mAcceptor; // Comment this line
public:
SocketTest(boost::asio::io_service& io_service)
: mIOService(io_service)
, mAcceptor(io_service, tcp::endpoint(tcp::v4(), 8080)) // Comment this line
{
}
};
タグ付けされた 2 行にコメントを付けると、コンパイラ (Visual Studio 2010) は /W4 でのコンパイル時に次の警告を出します。
warning C4512: 'SocketTest' : assignment operator could not be generated
この 2 行が特別な理由は何ですか? それらの存在により代入演算子の生成が可能になるのはなぜですか?