Document number: P0505R0


Howard E. Hinnant
2016-11-09

Wording for GB 50

Proposed Wording

  1. Modify the synopsis of 20.17.5 [time.duration]:

    template <class Rep, class Period = ratio<1>>
    class duration {
    public:
        using rep    = Rep;
        using period = Period;
    private:
        rep rep_; // exposition only public:
    public:
        // 20.17.5.1, construct/copy/destroy:
        constexpr duration() = default;
        template <class Rep2>
            constexpr explicit duration(const Rep2& r);
        template <class Rep2, class Period2>
            constexpr duration(const duration<Rep2, Period2>& d);
        ~duration() = default;
        duration(const duration&) = default;
        duration& operator=(const duration&) = default;
    
        // 20.17.5.2, observer:
        constexpr rep count() const;
    
        // 20.17.5.3, arithmetic:
        constexpr duration operator+() const;
        constexpr duration operator-() const;
        constexpr duration& operator++();
        constexpr duration operator++(int);
        constexpr duration& operator--();
        constexpr duration operator--(int);
    
        constexpr duration& operator+=(const duration& d);
        constexpr duration& operator-=(const duration& d);
    
        constexpr duration& operator*=(const rep& rhs);
        constexpr duration& operator/=(const rep& rhs);
        constexpr duration& operator%=(const rep& rhs);
        constexpr duration& operator%=(const duration& rhs);
    
        // 20.17.5.4, special values:
        static constexpr duration zero();
        static constexpr duration min();
        static constexpr duration max();
    };
    
  2. Modify 20.17.5.3 [time.duration.arithmetic]:

    ...
    constexpr duration& operator++();
    ...
    constexpr duration operator++(int);
    ...
    constexpr duration& operator--();
    ...
    constexpr duration operator--(int);
    ...
    constexpr duration& operator+=(const duration& d);
    ...
    constexpr duration& operator-=(const duration& d);
    ...
    constexpr duration& operator*=(const rep& rhs);
    ...
    constexpr duration& operator/=(const rep& rhs);
    ...
    constexpr duration& operator%=(const rep& rhs);
    ...
    constexpr duration& operator%=(const duration& rhs);
    ...
    
  3. Modify the synopsis of 20.17.6 [time.point]:

    template <class Clock, class Duration = typename Clock::duration>
    class time_point {
    public:
        using clock    = Clock;
        using duration = Duration;
        using rep      = typename duration::rep;
        using period   = typename duration::period;
    private:
        duration d_;  // exposition only
    public:
        // 20.17.6.1, construct:
        constexpr time_point(); // has value epoch
        constexpr explicit time_point(const duration& d);  // same as time_point() + d
        template <class Duration2>
            constexpr time_point(const time_point<clock, Duration2>& t);
    
        // 20.17.6.2, observer:
        constexpr duration time_since_epoch() const;
    
        // 20.17.6.3, arithmetic:
        constexpr time_point& operator+=(const duration& d);
        constexpr time_point& operator-=(const duration& d);
    
        // 20.17.6.4, special values:
        static constexpr time_point min();
        static constexpr time_point max();
    };
    
  4. Modify 20.17.6.3 [time.point.arithmetic]:

    ...
    constexpr time_point& operator+=(const duration& d);
    ...
    constexpr time_point& operator-=(const duration& d);
    ...