Boost logo

Boost Users :

Subject: Re: [Boost-users] [Fusion] Associative Sequence not so associative
From: Joel de Guzman (djowel_at_[hidden])
Date: 2013-01-29 20:14:48


On 1/29/13 8:25 PM, TONGARI wrote:
> Hi Joel,
>
> 2013/1/29 Joel de Guzman <djowel_at_[hidden]>
>
>> On 1/29/13 5:36 PM, TONGARI wrote:
>>
>>> Hi,
>>>
>>> I'd expect the associative sequence could be constructed and assigned with
>>> another sequence in different order.
>>> But it doesn't work, the src sequence must in the same order as the
>>> dst sequence defined.
>>> E.g. map<pair<K1, int>, pair<K2, int> > cannot take make_map<K2, K1>(1,
>>> 2).
>>>
>>> This is a bit disappointing :-(
>>>
>>
>> Yep. It's the way it is currently. I might be reworking maps though
>> so I'll keep this use-case in mind with the update.
>>
>
> Thanks for your attention :)
> Now I'm thinking if we could have these:
>
> mapping(dst, src) // all the intersected
> left_mapping(dst, src) // requires dst <= src
> right_mapping(dst, src) // requires dst >= src
> full_mapping(dst, src) // requires equivalence

Makes sense. Would you be interested to contribute these code?

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://boost-spirit.com

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