Boost logo

Boost Users :

Subject: Re: [Boost-users] getting started with Boost::Units
From: Mark Volkmann (mark_at_[hidden])
Date: 2009-01-09 09:44:13


I could be misunderstanding something fundamental about Boost::Units.
Is it possible to declare a class field or method parameter with a
type that indicates it represents a velocity without specifying
whether the value is in meters per second or miles per hour?

I'd like to allow any kind of velocity to be specified and perform
operations independent of the units being used. For example, if I set
the velocity of some object to 60 miles per hour and then call a
method to determine how far it will travel in 2 hours, I'd like to get
back 120 miles. I'd also like to be able to set the velocity to 10
meters per second, ask the same question, and get back 72000 meters.

---
Mark Volkmann

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