我有这个代码:
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
谢谢!