1[/ 2 / Copyright (c) 2003-2021 Christopher M. Kohlhoff (chris at kohlhoff dot com) 3 / 4 / Distributed under the Boost Software License, Version 1.0. (See accompanying 5 / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 /] 7 8[section:TimeTraits Time traits requirements] 9 10In the table below, `X` denotes a time traits class for time type `Time`, `t`, 11`t1`, and `t2` denote values of type `Time`, and `d` denotes a value of type 12`X::duration_type`. 13 14[table TimeTraits requirements 15 [[expression] [return type] [assertion/note[br]pre/post-condition]] 16 [ 17 [`X::time_type`] 18 [`Time`] 19 [ 20 Represents an absolute time. Must support default construction, and meet 21 the requirements for `CopyConstructible` and `Assignable`. 22 ] 23 ] 24 [ 25 [`X::duration_type`] 26 [] 27 [ 28 Represents the difference between two absolute times. Must support 29 default construction, and meet the requirements for `CopyConstructible` 30 and `Assignable`. A duration can be positive, negative, or zero. 31 ] 32 ] 33 [ 34 [`X::now();`] 35 [`time_type`] 36 [ 37 Returns the current time. 38 ] 39 ] 40 [ 41 [`X::add(t, d);`] 42 [`time_type`] 43 [ 44 Returns a new absolute time resulting from adding the duration `d` to the 45 absolute time `t`. 46 ] 47 ] 48 [ 49 [`X::subtract(t1, t2);`] 50 [`duration_type`] 51 [ 52 Returns the duration resulting from subtracting `t2` from `t1`. 53 ] 54 ] 55 [ 56 [`X::less_than(t1, t2);`] 57 [`bool`] 58 [ 59 Returns whether `t1` is to be treated as less than `t2`. 60 ] 61 ] 62 [ 63 [`X::to_posix_duration(d);`] 64 [`date_time::time_duration_type`] 65 [ 66 Returns the `date_time::time_duration_type` value that most closely 67 represents the duration `d`. 68 ] 69 ] 70] 71 72[endsect] 73