Page MenuHomePhabricator

Support relaxed constexpr on chrono::duration operations

Authored by AntonBikineev on Nov 28 2016, 5:20 AM.



This addresses a proposal p0505r0. Synopsis as follows:

template <class Rep, class Period = ratio<1>>
class duration {
    //, 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);

Diff Detail

Event Timeline

AntonBikineev retitled this revision from to Support relaxed constexpr on chrono::duration operations.
AntonBikineev updated this object.
AntonBikineev added reviewers: mclow.lists, EricWF.
mclow.lists edited edge metadata.Nov 28 2016, 10:23 AM

This looks good to me. Don't forget to update www/cxx1z_status.html (about line 136)

Also should have cfe-commits as a subscriber.

AntonBikineev edited edge metadata.
AntonBikineev added a subscriber: cfe-commits.
EricWF accepted this revision.Dec 5 2016, 1:36 AM
EricWF edited edge metadata.

LGTM as well.

This revision is now accepted and ready to land.Dec 5 2016, 1:36 AM
AntonBikineev abandoned this revision.Jan 23 2018, 4:01 AM