1122. Ratio values should be constexpr

Section: 23.16.3 [ratio.ratio] Status: Resolved Submitter: Alisdair Meredith Opened: 2009-05-25 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [ratio.ratio].

View all issues with Resolved status.

Discussion:

The values num and den in the ratio template should be declared constexpr.

[ 2009-10 Santa Cruz: ]

NAD EditorialResolved. Solved by N2994.

Proposed resolution:

23.16.3 [ratio.ratio]

namespace std {
  template <intmax_t N, intmax_t D = 1>
  class ratio {
  public:
    static constexpr intmax_t num;
    static constexpr intmax_t den;
  };
}