|
Boost : |
Subject: Re: [boost] How to use mutable_queue with non basic types
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-04-12 08:52:15
On Mon, 12 Apr 2010, Emili Hernàndez wrote:
> Jeremiah Willcock escribió:
>> On Fri, 9 Apr 2010, Emili Hernàndez wrote:
>>
>>> Hi all,
>>>
>>> I've used mutable_queue with basic types (double and int) with no
>>> problem.
>>> Now I trying to do it with my own type:
>>>
>>> typedef MyObject entry_t;
>>> typedef vector<entry_t> storage_t;
>>> typedef MySortingCriterion comp_t;
>>> typedef boost::identity_property_map prop_map_t;
>>> typedef boost::mutable_queue<entry_t, storage_t, comp_t, prop_map_t>
>>> queue_t;
>>
>> identity_property_map is only for unsigned ints (it's that way for
>> historical reasons). Use typed_identity_property_map<entry_t> as
>> prop_map_t and see if that fixes your problem.
>>
>> -- Jeremiah Willcock
>>
> Hi,
> I've tried what you suggested and another error apperars:
Could you please post the relevant part of the new code? It appears that
the storage indexing is messed up in the property map, and it could be
that you need a different index map (if you're using
boost::shared_ptr<CAStarNode> as the index type in the property map).
> it seams that the operator[] has to be defined but I don't understand
> why is it required if it is already specified to use a vector<entry_t>
> as storage type
>
> Any suggestion?
> Is there a full example on how to use mutable_queue with non-basic types??
I doubt it -- mutable_queue is mostly used internally. If we end up
working one out together I can put it in, though.
-- Jeremiah Willcock
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk