Q:

Can a map have different dimensions for each item?

I'd like to use boost units for a project I work on, but before I start I'd like to check that it's appropriate for what I want to do. I've checked the documentation and the code, but I don't see an example that assures me that I can do what I need. I am a scientist, not a programmer, so I'm not familiar with the details of how this works.
I use maps to store quantities, and the quantities have different dimensions. It looks like a quantity must be associated with a dimension or unit though. Is something like the following possible?
map<string, quantity<>> parameters;  // I don't know what to put here. Is there a class that represents a quantity without immediately specificying the dimension or unit?

parameters["distance"] = 2 * meters;
parameters["duration"] = 30 * seconds;

quantity<velocity> v = parameters.at("distance") / parameters.at("duration");

My goal is a map with the most general concept of a quantity, i.e., a value with units.
Whereas all of the examples have quantity with a value and specific units.

A:

No, boost units is for compile time checks.  Dynamicly chosen objects cannot easily be checked this way.
Use a struct instead of a map.

