Justin - 2017-05-26

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");
 

Last edit: Justin 2017-05-26