• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function template
    <mdspan>

    std::layout_right::mapping::operator==

    template<class OtherExtents>
    friend constexpr bool operator==(
      const mapping& x, const mapping<OtherExtents>& y) noexcept;
    
    //operator==により、以下のオーバーロードが使用可能になる        
    template<class OtherExtents>
    friend constexpr bool operator!=(
      const mapping& x, const mapping<OtherExtents>& y) noexcept;
    

    概要

    mappingの等値比較を行う。

    テンプレートパラメータ制約

    extents_type::rank() == OtherExtents::rank()

    戻り値

    x.extents() == y.extents()

    例外

    投げない

    #include <cassert>
    #include <mdspan>
    
    int main()
    {
      using Ext3x4 = std::extents<size_t, 3, 4>;
      using Mapping3x4 = std::layout_right::mapping<Ext3x4>;
      Mapping3x4 map1;
    
      using Ext3xN = std::extents<size_t, 3, std::dynamic_extent>;
      using Mapping3xN = std::layout_right::mapping<Ext3xN>;
      Mapping3xN map2{Ext3xN{4}};
    
      assert(map1 == map2);
    }
    

    出力

    バージョン

    言語

    • C++23

    処理系

    参照