我有这段代码:
class Connection
{
public:
boost::asio::ip::tcp::socket socket_;
}
void main()
{
Connection* session = new Connection();
//for example
session->socket_.close() // FATAL ERROR PAGE FAULT
// How to check whether child member socket_ is null? if(session->socket_ != NULL) - error : no operator != mathes these operands
}
当我尝试if(session->socket_ != NULL)
时 - 错误:没有操作符!=将这些操作数匹配
我使用VS2010
谢谢!