[time.traits.duration.values]

# 30 Time library [[time]](./#time)

## 30.4 Time-related traits [[time.traits]](time.traits#duration.values)

### 30.4.2 duration_values [time.traits.duration.values]

[ð](#lib:duration_values)

`template<class Rep>
  struct duration_values {
  public:
    static constexpr Rep zero() noexcept;
    static constexpr Rep min() noexcept;
    static constexpr Rep max() noexcept;
  };
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1098)

The duration template uses the duration_values trait to
construct special values of the duration's representation (Rep)[.](#1.sentence-1)

This is
done because the representation can be a class type with behavior that
requires some other implementation to return these special values[.](#1.sentence-2)

In that case,
the author of that class type should specialize duration_values to
return the indicated values[.](#1.sentence-3)

[ð](#lib:zero,duration_values)

`static constexpr Rep zero() noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1112)

*Returns*: Rep(0)[.](#2.sentence-1)

[*Note [1](#note-1)*:

Rep(0) is specified instead ofRep() because Rep() can have some other meaning, such as an
uninitialized value[.](#2.sentence-2)

â *end note*]

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1121)

*Remarks*: The value returned shall be the additive identity[.](#3.sentence-1)

[ð](#lib:min,duration_values)

`static constexpr Rep min() noexcept;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1132)

*Returns*: numeric_limits<Rep>​::​lowest()[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1136)

*Remarks*: The value returned shall compare less than or equal to zero()[.](#5.sentence-1)

[ð](#lib:max,duration_values)

`static constexpr Rep max() noexcept;
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1147)

*Returns*: numeric_limits<Rep>​::​max()[.](#6.sentence-1)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/time.tex#L1151)

*Remarks*: The value returned shall compare greater than zero()[.](#7.sentence-1)
