使用命名空间shared_ptr:spa
using boost::shared_ptr;server
调用 shared_ptr 的代码:命名空间
shared_ptr<XXXXServiceHandler> handler(new XXXXServiceHandler(data));sso
shared_ptr<TProcessor> processor(new FrontServiceProcessor(handler));命名
shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));vi
shared_ptr<TTransportFactory> transportFactory(new TFramedTransportFactory());process
shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());handler
修改:co
boost::shared_ptr<XXXXServiceHandler> handler(new XXXXServiceHandler(data));boost
boost::shared_ptr<TProcessor> processor(new FrontServiceProcessor(handler));
boost::shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
boost::shared_ptr<TTransportFactory> transportFactory(new TFramedTransportFactory());
boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());