Boost logo

Boost Users :

From: Hicham Mouline (hicham_at_[hidden])
Date: 2008-05-01 18:21:01


Yes, I suppose it's what I want.
Every contract/model has its own header file.
In each, I can extend the map (in the first header, the map will start from
empty.
In subsequent headers, the map will be extended)

The test suite will have a number of translation units to spread the work,
Each would include just some of the headers, building partial maps.

My models have only static functions, there are no instances.

Best,

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Sohail Somani
Sent: 01 May 2008 20:18
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] mpl mutlimap

Hicham Mouline wrote:
> hello,
> as i don't immediately see an MPL equivalent of multimap, here is what i
am trying to achieve.
>
> I have a number of models (200 types, all of them inherit from 1 base
class)
> and a number of contracts(400 types, also all them inherit from 1 base
class),
> and I try to write a test suite for valid combinations.
> Was there a multimap in MPL, i would have stored this matrix:
> model1 contract1, contract17, contract156
> model2 contract17
> ...
> model200 contract23
>
> or symetrically, indexed by contract
> in a multimap.

Does this not work?

typedef mpl::map< mpl::pair<model1,mpl::set<contract1,contract2>,
                   mpl::pair<model2,mpl::set<contract3,contract4> >
    valid_combos_map_t;

That is gonna be a huge map though. It might be easier on your compiler
for you to move this to a runtime map.


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