Boost logo

Boost Users :

From: ukropina_at_[hidden]
Date: 2004-03-18 15:10:32


('binary' encoding is not supported, stored as-is)
Hi
I'm trying to compile the sample code for singleton pool from
http://www.boost.org/libs/pool/doc/interfaces.html
just to learn how to use singleton pool.

Here is the code.

struct MyPoolTag { };

typedef boost::singleton_pool<MyPoolTag, sizeof(int)> my_pool;
void func()
{
  for (int i = 0; i < 10000; ++i)
  {
    int * const t = my_pool::malloc();
  }
  my_pool::purge_memory();
}

but I keep geting this error:

Compiling...
main.cpp
c:\program files\microsoft visual studio\vc98\include\xmemory(59) : error
C2248: 'object_creator' : cannot access private struct declared in class
'boost::details::pool::singleton_default<struct boost::singleton_pool<struct
MyPoolTag,4,struct boost:
:default_user_allocator_new_delete,class
boost::details::pool::win32_mutex,32>::pool_type>'
        e:\lib\boost\boost\pool\detail\singleton.hpp(63) : see declaration
of 'object_creator'
        c:\program files\microsoft visual studio\vc98\include\xmemory(59) :
while compiling class-template static data member 'struct
boost::details::pool::singleton_default<struct boost::singleton_pool<struct
MyPoolTag,4,struct boost::default_user_
allocator_new_delete,class
boost::details::pool::win32_mutex,32>::pool_type>::object_creator
ol_type>::create_object'
Error executing xicl6.exe.



I'm using MS Visual C++ 6.0 SP5 on windows XP.
What am I doing wrong ?
Does anyone have a sample code for singleton pool that works on windows ?

Thanks

Nenad
boost::details::pool::singleton_default<boost::singleton_pool<,4,boost::defa
ult_user_allocator_new_delete,boost::details::pool::win32_mutex,32>::po

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net