Boost logo

Boost Users :

Subject: Re: [Boost-users] Possibly too newbie a question?
From: Eric Whitcombe (ericwsf_at_[hidden])
Date: 2010-03-17 18:59:58


Thanks I just stumbled on that earlier today. It confounds me that the
parameter is renamed from VoidPointer to VoidMutex ???!!!
that is basically how I missed it. I thought there was some inscurtable
argument deduction going on.

Thanks so much Gevorg.

----- Original Message -----
From: "Gevorg Voskanyan" <v_gevorg_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Wednesday, March 17, 2010 5:30 PM
Subject: Re: [Boost-users] Possibly too newbie a question?

> Eric Whitcombe wrote:
>>>> I am stepping through interprocess shared memory code and I was a
>>>> little
>>>> confused by the offset_ptr code that I was
>>>> hitting*. I cannot figure out how that is specified to the template
>>>> of rbtree_best_fit. I see in boost/interprocess/interprocess_fwd.hpp
>>>> the declaration
>>>> of managed_shared_memory by typedef'ing basic_managed_shared_memory
>>>> with rbtree_best_fit<mutex_family> as the
>>>> AllocationAlgorithm argument but I can't figure out how offset_ptr is
>>>> is supplied as the VoidPointer >>> argument to the rbtree_best_fit
>>>> template. That
>>>> template has 3 arguments but the forward declaration only provides
>>>> one. Are
>>>> the other two somehow inferred? If so, how?
>
>
> rbtree_best_fit<mutex_family> works because rbtree_best_fit
> class template's declaration specifies default arguments for
> VoidMutex and MemAlignment template parameters, shown here:
> template<class MutexFamily, class VoidMutex = offset_ptr<void>,
> std::size_t MemAlignment = 0>
> class rbtree_best_fit;
>
> So rbtree_best_fit<mutex_family> is equivalent to
> rbtree_best_fit<mutex_family, offset_ptr<void>, 0>
>
> Does that answer your question, or have I misunderstood it?
>
> HTH,
> Gevorg
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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