GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — 非推奨だった組み込み配列の比較を削除 [P2865R6] - cpprefjp C++日本語リファレンス

  1. 言語機能
  2. C++26
  3. 非推奨だった組み込み配列の比較を削除 [P2865R6]

最終更新日時: 2025年09月03日 23時44分58秒 (JST)
ACUVE が更新

履歴 編集

非推奨だった組み込み配列の比較を削除 [P2865R6](C++26)

このページはC++26に採用される見込みの言語機能の変更を解説しています。

のちのC++規格でさらに変更される場合があるため関連項目を参照してください。

概要

C++20での三方比較演算子の導入にともない、組み込み配列の等値比較および関係比較は非推奨となっていたが、これを削除する。

組み込み配列同士の三方比較はC++20時点で不適格である。

int arr1[5];
int arr2[5];
bool same = arr1 == arr2; // C++20: 非推奨、C++26: エラー。
                          // &arr1[0] == &arr2[0]と同じ。
                          // 配列の要素は比較されない
auto cmp = arr1 <=> arr2; // エラー!

関連項目

  • C++20 <=>/==による比較演算子の自動定義
  • C++20 組み込み配列の比較を非推奨化

参照

  • P2865R6 Remove Deprecated Array Comparisons from C++26
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.