feat(integer_sequence): integer_sequenceに関するテンプレートパラメータ制約と備考を追加#1610
Open
teruyamato0731 wants to merge 1 commit intomasterfrom
Open
feat(integer_sequence): integer_sequenceに関するテンプレートパラメータ制約と備考を追加#1610teruyamato0731 wants to merge 1 commit intomasterfrom
teruyamato0731 wants to merge 1 commit intomasterfrom
Conversation
Contributor
|
⚡ プレビュー (HTML) (更新時刻: 2026-04-13 01:37:08 JST) 変更記事一覧1件の記事が変更されました。 ※ソース (.md) に直接変更のあった記事を列挙しています。グローバル修飾や変換規則の変更による変化は考慮していません。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
std::integer_sequenceのテンプレートパラメータTに関する制約について、C++17からC++20にかけての仕様変更(Mandates:への厳格化)を追記します。変更の背景
C++20における標準ライブラリの要件記述の見直し(P1460R1)により、
Tが整数型であることの要件がshall beからMandatesに変更されました。C++17(N4659)
C++20(N4861)
これにより、C++20以降では
Tに整数型以外を渡した場合にコンパイラが確実に診断メッセージ(エラー)を出すこと(static_assert等によるハードエラー)が規格で要求されるようになりました。実際のコンパイラ(GCC等)でも、C++20モードから
static_assert(is_integral_v<T>);が発動するように実装が変更されているため、ユーザー向けの注意喚起として備考に追記しました。GCCによる実装:
参考