template<class OtherIndexType, size_t... OtherExtents>
friend constexpr bool operator==(
const extents& lhs,
const extents<OtherIndexType, OtherExtents...>& rhs) noexcept;
//operator==により、以下のオーバーロードが使用可能になる
template<class OtherIndexType, size_t... OtherExtents>
friend constexpr bool operator!=(
const extents& lhs,
const extents<OtherIndexType, OtherExtents...>& rhs) noexcept;
概要
extentsの等値比較を行う。
戻り値
lhsとrhsの次元数rankが等しく、かつ全次元の要素数extentが等しいときにtrueを返す。そうでなければfalseを返す。
例外
投げない
例
#include <cassert>
#include <mdspan>
int main()
{
using Ext3x4 = std::extents<size_t, 3, 4>;
Ext3x4 ext1;
using Ext3xN = std::extents<size_t, 3, std::dynamic_extent>;
Ext3xN ext2{4};
assert(ext1 == ext2);
}
出力
バージョン
言語
- C++23
処理系
- Clang: ??
- GCC: ??
- ICC: ??
- Visual C++: ??