Boost logo

Boost :

Subject: Re: [boost] [units] Interest in UDLs (e.g. _kg) for units?
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2014-08-22 05:26:17


On August 22, 2014 4:08:34 AM EDT, Curdeius Curdeius <curdeius_at_[hidden]> wrote:
>
>I was wondering if there is any interest in adding User-Defined
>Literals (UDLs) to Boost.Units.
>
>IMO, it could simplify some code and improve code readability in some
>cases.
>For example instead of writing (it's a somehow artificial example)
> 5.34 * si::milli * si::kilogram;
> 1234 * si::kilogram;
>one would write
> 5.34_g;
> 1234_kg;

That would be much more readable, so the idea has merit. Usability, compile-time overhead, diagnostics, etc. would be factors in evaluating the result.

___
Rob

(Sent from my portable computation engine)


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