|
Boost : |
From: Anatoli Tubman (anatoli_at_[hidden])
Date: 2004-01-08 05:17:23
On Wednesday 07 January 2004 11:53, Daniel Frey wrote:
> Definitly. Why isn't the current operator ^ spelled ~ anyway? Then ^
> could have the right precedence and meaning. Think of m/s^2. Damn
> C-ompatibility ;)
Alas, this won't help because m^2 and m^3 should have different types.
One needs an ability to overload on integral constant expressions:
unit::m2 operator^ (unit::m x, 2) { ... }
unit::m3 operator^ (unit::m x, 3) { ... }
;)
-- anatoli at ptc dot com -- opinions are mine
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk