This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.

2759. gcd / lcm and bool for the WP

Section: 26.10.14 [numeric.ops.gcd], 26.10.15 [numeric.ops.lcm] Status: C++17 Submitter: Walter Brown Opened: 2016-08-01 Last modified: 2017-07-30

Priority: Not Prioritized

View all other issues in [numeric.ops.gcd].

View all issues with C++17 status.

Discussion:

With the acceptance of gcd and lcm in the working draft, the same problem as pointed out by LWG 2733(i) exists here as well and should be fixed accordingly.

[2016-08, Chicago]

Monday PM: Moved to Tentatively Ready

Proposed resolution:

This wording is relative to N4606.

  1. Adjust 26.10.14 [numeric.ops.gcd] p2 as indicated:

    template<class M, class N>
      constexpr common_type_t<M, N> gcd(M m, N n);
    

    […]

    -2- Remarks: If either M or N is not an integer type, or if either is (possibly cv-qualified) bool, the program is ill-formed.

  2. Adjust 26.10.15 [numeric.ops.lcm] p2 as indicated:

    template<class M, class N>
      constexpr common_type_t<M, N> lcm(M m, N n);
    

    […]

    -2- Remarks: If either M or N is not an integer type, or if either is (possibly cv-qualified) bool, the program is ill-formed.