Boost logo

Boost :

From: Andrey Semashev (andysem_at_[hidden])
Date: 2007-06-10 14:12:53


Hello Matias,

Sunday, June 10, 2007, 6:41:37 PM, you wrote:

> On 6/10/07, Andrey Semashev <andysem_at_[hidden]> wrote:

> Hi andrey

[snip]

>> What is the value_type of the container then?

> Why is that important to you? Even when you do not use additional information
> the value type of the container is an implementation detail. But
> that's is why value_type exists. You do no have to worry about the
> implementation type.

>> What are the names of
>> the two keys and info in it?

[snip]

>> As I'm not hoping it is more or less
>> relevant to their real semantic, I don't think it's the best choice
>> for me, because this value_type is exposed to other components of the
>> application.

> I do not see a problem here.

>> Obscure names of value_type members,

> They are not obscure.

Well, they tell nothing about their purpose. That's what I always
disliked about std::pair - the expression v.second doesn't tell you
anything. And v.left or v.right don't make it better, especially
assuming that my component doesn't express any such symmetry. v.Mask
or v.ID are much more telling in the user's code.

[snip]

> I am not saying that a bimap is better than a multi_index_container
> here. I just want to point out that you "can" use it if you want.

Aside naming and dependency issues, I see bimap is based on the
Boost.MultiIndex. I showed I can't use B.MI for my case because of its
requirements on functors. Does bimap change B.MI's requirements on
them? If not, I don't see how it is better in this way.

Anyway, thank you for your helping efforts. I'm sure bimap has its
field of use, but I'm afraid it's not the case.

-- 
Best regards,
 Andrey                            mailto:andysem_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk