#define BOOSTPOOL boost::pool<>
BOOSTPOOL GetPool()
{
BOOSTPOOL AppClass1Pool(sizeof(AppClass1));
return AppClass1Pool;
}
void* AppClass1::operator new(size_t sz)
{
BOOSTPOOL temp = GetPool();
void* p =(void*) temp.malloc();
return p;
}
can not access to the private member(in “boost::simple_segregated_storage<SizeType>”)
I can not use pool like this?
I don’t see what you are trying to do with the code shown.
Also, chances are that the error originates in the code you don’t show, but here’s my 5p:
Pools are non-copyable. I assume, under C++03 you get
can not access to the private memberbecause the copy constructor is private. In c++11 you can expect:Here is a fixed-up version that probably does what you intended: