Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2003-09-03 07:47:59


On Tue, 02 Sep 2003 18:27:59 -0400, David Abrahams wrote
> Suppose I want to know how many minutes there are in a particular
> duration d? My intuition says:
>
> d / minutes(1)
>
> But there's no such operator. Why not?

An interesting point. Probably should be possible. While addition and
subtraction operators are specified in terms of durations division and
multiplication are defined with integers not other durations. I'm thinking it
would have to be defined like this
  Duration / Duration --> Integer

Anyway d.minutes() should do what you want.

Jeff


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