Movatterモバイル変換


[0]ホーム

URL:



This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofC++20 status.

3201.lerp should be marked asnoexcept

Section: 29.7.4[c.math.lerp]Status:C++20Submitter: Paolo TorresOpened: 2019-04-10Last modified: 2021-02-25

Priority:2

View all issues withC++20 status.

Discussion:

The overloads oflerp should be marked asnoexcept, and this can be explained through the Lakos Rule. This function does not specify any undefined behaviour, and as such has no preconditions. This implies it has a wide contract, meaning it cannot throw, and thus can be marked asnoexcept.

[2020-02 Moved to Immediate on Thursday afternoon in Prague.]

Proposed resolution:

This wording is relative toN4810.

  1. Modify 29.7.1[cmath.syn], header<cmath> synopsis, as indicated:

    // 29.7.4[c.math.lerp], linear interpolationconstexpr float lerp(float a, float b, float t)noexcept;constexpr double lerp(double a, double b, double t)noexcept;constexpr long double lerp(long double a, long double b, long double t)noexcept;
  2. Modify 29.7.4[c.math.lerp] as indicated:

    constexpr float lerp(float a, float b, float t)noexcept;constexpr double lerp(double a, double b, double t)noexcept;constexpr long double lerp(long double a, long double b, long double t)noexcept;

[8]ページ先頭

©2009-2026 Movatter.jp