Boost logo

Boost Users :

From: Paul Baxter (pauljbaxter_at_[hidden])
Date: 2005-12-08 18:25:03


From: "Paul Baxter" <pauljbaxter_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
Sent: Thursday, December 08, 2005 10:34 PM
Subject: Re: mapping strings to indexes at compile time -MPLmap?

>> "Paul Baxter" <pauljbaxter_at_[hidden]> writes:
>>
>>> I have a fixed list of parameter names and with each an associated
>>> set of attributes. I wish to access the attributes via the parameter
>>> name rather than the equivalent list entry index.
>>>
>>> In the past, we've created ENUMs with meaningful names to represent
>>> the parameter name->index mapping but I can't help feeling there
>>> must be a better way usng the name directly without this extra
>>> artificial mapping type.
>>
>>
>> Is there some reason http://www.boost.org/libs/parameter is not
>> appropriate for you?
>
> The parameter library looks like an incredibly useful library, I'm not
> sure
> it is what I'm looking for though, but am happy if you could give me an
> example. I'm looking for something that does the name->index 'lookup' at
> compile time. (Sorry if this fact wasn't made clearer). My initial reading
> of parameter is that it is solving a different problem.

Just to clarify, the parameter lib appears to do much of what it does at
compile time, but I'm having a bit of difficulty mapping my concepts to
parameter.

Since Dave is rarely mistaken, I am trying to grapple with this further.

I want a constant map with parameter names as key. These are associated with
a tuple of pre-defined fixed attributes.

I'm pretty sure much of the behind the scenes machinery that makes parameter
work may be appropriate to this solution, but can't figure if the current
machinery for parameter would help in its current form.

Paul


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