Boost logo

Boost :

Subject: Re: [boost] [units] Interest in UDLs (e.g. _kg) for units?
From: Jürgen Hunold (jhunold_at_[hidden])
Date: 2014-08-27 06:08:34


Am Mittwoch, 27. August 2014, 11:01:46 schrieb Bo Persson:
> Paul A. Bristow skrev den 2014-08-26 19:13:
> >> -----Original Message-----
> >> From: Boost [mailto:boost-bounces_at_[hidden]] On Behalf Of Marek
> >> Kurdej Sent: 25 August 2014 17:31

> >> Yes, the idea is to include all the prefix variants as well, so for the
> >> mass, we will have:
> >> ..., _ng, _ug (?), _mg, _g, _kg, _Mg,_Gg, _Tg, ...
> >> And, the fact is, writing si::milli * si::kilogram is counterintuitive as
> >> you have just experienced on your own.
> >
> > Looks much nicer!

Yes, supporting variants most is definetely a must.

> > Will reduce the user resistance to using Boost.Units - it's a bit verbose
> > for mere engineers and scientist's taste ;-)
> >
> > But have you implemented it yet?
> >
> > (and are there any hidden gotchas? - the proposed C++ time literals
> > suffixes proved to be a can of worms :-(

One of the Boost goals is to find gotchas before they enter the standard. As
long as this is an optional add-in, I'm all for it.

> One known problem is that the kg is the base unit, despite its prefix.
> That makes the higher units a bit odd. I have never ever seen Mg used,
> it would be called a ton (metric...). Then we have megatons, but never
> teragrams.
>
> Closing the can before anything bad happens...

Well, kilotons are also used. And we have km but not mm :-)

Am Freitag, 22. August 2014, 10:08:34 schrieb Curdeius Curdeius:
> The user would have to pull corresponding namespace (let's call it `udl`)
> to use it, for example
>
> using namespace boost::units::systems::si::udl; // bring _kg, _km, ...
>
> into scope

I think boost::units::systems::si:literals is a better namespace.

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold  ! 
* voice: ++49 4257 300       ! Fährstraße 1
* fax  : ++49 4257 300       ! 31609 Balge/Sebbenhausen
* jhunold_at_gmx.eu             ! Germany

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk