Boost::Pool - Singleton_pool

View: New views
2 Messages — Rating Filter:   Alert me  

Boost::Pool - Singleton_pool

by oslu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Parent Message unknown Re: Boost::Pool - Singleton_pool

by Paul Byrne-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> From: Ondrej Sluciak <ondrej.sluciak@...>
> To: boost-users@...
> Subject: [Boost-users] Boost::Pool - Singleton_pool
> Message-ID: <4AEEFEED.7030905@...>
> 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 mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users