Boost logo

Boost :

From: Janek Kozicki (janek_listy_at_[hidden])
Date: 2006-06-09 20:18:33


Andy Little said: (by the date of Fri, 9 Jun 2006 16:11:14 +0100)

> FWIW this syntax is trival in PQS:
>
> typedef pqs::length::m length;
> typedef pqs::time::s time;
> typedef pqs::velocity::m_div_s velocity;
>
> length meter(){return length(1);}
> time second(){return time(1);}
> velocity x = 10 * meter() / second();
>
> IOW If you prefer to work this way you can.

It's a very interesting idea!

Maybe you could provide some extra header file that will provide such
functionality? Those functions - being inline should not even affect the
runtime speed?

mixed units (like velocity) would then default to the base si units
(like m/s in this case)

-- 
Janek Kozicki                                                         |

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