|
Boost : |
From: Rainer Deyke (root_at_[hidden])
Date: 2001-04-12 23:53:05
----- Original Message -----
From: "Dejan Jelovic" <djelovic_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, April 12, 2001 12:54 PM
Subject: [boost] arithmetic type wrapper
> class meters_tag;
> typedef arithmetic_type_wrapper<double, meters_tag> meters;
>
> class feet_tag;
> typedef arithmetic_type_wrapper<double, feet_tag> feet;
>
>
> meters m = meters (10) + meters (20); //ok
>
> feet f = feet (5) + feet (10); // ok
>
> meters (10) + feet (20); // oops, compile-time error
Wouldn't it be more useful to define conversions between feet and meters?
-- Rainer Deyke (root_at_[hidden]) Shareware computer games - http://rainerdeyke.com "In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk