Take the following bit of code that uses 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
{
}
};
If you comment the two tagged lines the compiler (Visual Studio 2010) gives out the following warning when compiling on /W4.
warning C4512: 'SocketTest' : assignment operator could not be generated
What makes those two lines so special? Why does their existence allow the generation of the assignment operator?