Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost::Pool - Singleton_pool
From: Paul Byrne (paulbyrne_at_[hidden])
Date: 2009-11-03 00:40:23


> From: Ondrej Sluciak <ondrej.sluciak_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: [Boost-users] Boost::Pool - Singleton_pool
> Message-ID: <4AEEFEED.7030905_at_[hidden]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
> Is there a way on how to derive a class from pool::singleton_pool class?
> Something like:
>
> template<typename T>
> genericsingleton : boost::singleton_pool<boost::pool_allocator_tag,
> sizeof(T)>
>
> If I want to do this I always get this error:
>
> Error 1 error C2248:
> 'boost::singleton_pool<Tag,RequestedSize>::singleton_pool' : cannot
> access private member declared in class
> 'boost::singleton_pool<Tag,RequestedSize>'
> c:\mycode\boosttest\boosttest\genericsingleton.h 23
>
> Thank you for answer.
>

Hi Ondrej,

I guess that you are getting this error when you try to construct an instance of your genericsingleton<> class. I don't believe that you will be able to do this because your base class has a private constructor. I suppose if you explain what your purpose is (by deriving from singleton_pool) then someone might be able to suggest a solution for you.

Regards, Paul


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