On Fri, Jul 12, 2002 at 10:55:03PM -0700, Aaron Bannert wrote: > On Fri, Jul 12, 2002 at 10:44:33PM -0700, Justin Erenkrantz wrote: > > As Roy pointed out, this is partial hiding. I'm now of the mind > > that it should be a full ADT under an abstract type. Therefore, > > the +/- operations should be handled by an API. (For performance > > reasons, it can be a macro - say apr_time_add/apr_time_diff which > > do the obvious C scalar operations.) But, under no circumstances > > for this solution, can the user do *anything* with the value > > without going through some API. > > Don't you think that will kill performance?
No. #define apr_time_add(time1, time2) time1+time2 #define apr_time_sub(time1, time2) time1-time2 #define apr_time_mul(time1, time2) time1*time2 #define apr_time_div(time1, time2) time1/time2 For more complex time structures, it could be a function. -- justin
