On Mon, Mar 7, 2011 at 5:35 PM, Matthias Schabel <boost@schabel-family.org> wrote:
#include <boost/units/quantity.hpp>
#include <boost/units/systems/si.hpp>
#include <boost/units/base_units/us/foot.hpp>

using namespace boost::units;

 

class Test {
  public:
    // takes any unit of length
    template<class System>
    void setX(quantity<unit<length_dimension,System> > const& x) {
      // explicit conversion to si::length = meters
      m_X = quantity<si::length>(x);
    }
  private:
    quantity<si::length> m_X;
};
 
void setY(quantity<unit<???, System> > const& y) {
  m_Y = quantity<si::dimensionless>(y);
}
 
I would like to be able to accept any systems dimensionless quantity.  Since dimensionless isn't a physical system I obviously didn't find a tag I could use like length_dimension.  What should I do here?
 
Ryan