Boost logo

Boost Users :

Subject: Re: [Boost-users] [units] Creating specific unit quantities
From: Matthias Schabel (boost_at_[hidden])
Date: 2011-03-16 18:13:16


> 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?

I'm getting the feeling that you're not trying very hard here... Look in the <boost/units> directory and you will find three headers : dimensionless_type.hpp, dimensionless_unit.hpp, and dimensionless_quantity.hpp, giving you a variety of options :

template<class System,class Y> void setA(quantity<unit<dimensionless_type,System>,Y>&) { }
template<class System,class Y> void setB(quantity<typename dimensionless_unit<System>::type,Y>&) { }
template<class System,class Y> void setC(typename dimensionless_quantity<System,Y>::type&) { }

Matthias



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