TimeTraits.qbk 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [/
  2. / Copyright (c) 2003-2019 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. [section:TimeTraits Time traits requirements]
  8. In the table below, `X` denotes a time traits class for time type `Time`, `t`,
  9. `t1`, and `t2` denote values of type `Time`, and `d` denotes a value of type
  10. `X::duration_type`.
  11. [table TimeTraits requirements
  12. [[expression] [return type] [assertion/note\npre/post-condition]]
  13. [
  14. [`X::time_type`]
  15. [`Time`]
  16. [
  17. Represents an absolute time. Must support default construction, and meet
  18. the requirements for `CopyConstructible` and `Assignable`.
  19. ]
  20. ]
  21. [
  22. [`X::duration_type`]
  23. []
  24. [
  25. Represents the difference between two absolute times. Must support
  26. default construction, and meet the requirements for `CopyConstructible`
  27. and `Assignable`. A duration can be positive, negative, or zero.
  28. ]
  29. ]
  30. [
  31. [`X::now();`]
  32. [`time_type`]
  33. [
  34. Returns the current time.
  35. ]
  36. ]
  37. [
  38. [`X::add(t, d);`]
  39. [`time_type`]
  40. [
  41. Returns a new absolute time resulting from adding the duration `d` to the
  42. absolute time `t`.
  43. ]
  44. ]
  45. [
  46. [`X::subtract(t1, t2);`]
  47. [`duration_type`]
  48. [
  49. Returns the duration resulting from subtracting `t2` from `t1`.
  50. ]
  51. ]
  52. [
  53. [`X::less_than(t1, t2);`]
  54. [`bool`]
  55. [
  56. Returns whether `t1` is to be treated as less than `t2`.
  57. ]
  58. ]
  59. [
  60. [`X::to_posix_duration(d);`]
  61. [`date_time::time_duration_type`]
  62. [
  63. Returns the `date_time::time_duration_type` value that most closely
  64. represents the duration `d`.
  65. ]
  66. ]
  67. ]
  68. [endsect]