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<Pm,I>' being compiled
1> with
1> [
1> Pm=void (__thiscall boost::object_pool<session>::* )(session *),
1> I=1
1> ]
1> d:\development\coreframework\portal\src\portal_server.cpp(16) : see reference to class template instantiation 'boost::_bi::dm_result<Pm,A1>' being compiled
1> with
1> [
1> Pm=void (__thiscall boost::object_pool<session>::* )(session *),
1> A1=portal_server::session_pool *__w64
1> ]
1>d:\development\boost_1_35_0\boost\mem_fn.hpp(318) : warning C4180: qualifier applied to function type has no meaning; ignored
1> d:\development\boost_1_35_0\boost\bind\bind_template.hpp(344) : see reference to class template instantiation 'boost::_mfi::dm<R,T>' being compiled
1> with
1> [
1> R=void (session *),
1> T=boost::object_pool<session>
1> ]
1>Project : error PRJ0002 : Error result 1 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\cl.exe'.
I use Microsoft visual studio 8 (vs2005).
Thanks all
Best regards.
Yours Kenneth.Sh