about shared_ptr and object_pool
Hi dear all.
I have a class named "session" look like below code:
class session : public boost::enable_shared_from_this< session >,
private boost::noncopyable
{
public:
session(boost::asio::io_service& io_service);
.....
};
I want use boost::object_pool for allocate memory for session.
class host
{
public:
typedef boost::object_pool<session> session_pool;
host()
: new_session_( session_pool_.construct(),
boost::bind(&session_pool::destroy, &session_pool_))
{
}
public:
boost::shared_ptr< session > new_session_;
session_pool session_pool_;
};
but there has a compiler error was occured:
1> d:\development\boost_1_35_0\boost\bind.hpp(1613) : warning C4180:
qualifier applied to function type has no meaning; ignored
1> d:\development\boost_1_35_0\boost\bind.hpp(1647) : see reference
to class template instantiation 'boost::_bi::add_cref
Hi lgor R
It's working now, very thanks for your help :)
Best regards.
Kenneth.Sh
2008/7/31 Igor R
: new_session_( session_pool_.construct(), boost::bind(&session_pool::destroy, &session_pool_))
boost::bind(&session_pool::destroy, &session_pool_, _1) _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Best Regards, Ken Zhang Greatelsoft Co., Ltd. mailto:ken@greatelsoft.com http://www.greatelsoft.com M/P:0086-1350-191-6596
participants (2)
-
Igor R
-
Ken zhang