• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <iterator>

    std::common_iterator::operator=

    template<class I2, class S2>
      requires convertible_to<const I2&, I> && convertible_to<const S2&, S> &&
               assignable_from<I&, const I2&> && assignable_from<S&, const S2&>
    common_iterator& operator=(const common_iterator<I2, S2>& x);
    

    概要

    common_iteratorオブジェクトをコピー代入する。

    事前条件

    x.v_.valueless_by_exception() == falseであること。

    効果

    I, Sの値のどちらかをvariant<I, S>型のメンバ変数v_に保持しており、i = x.v_.index()として、次のどちらか

    • i == v_.index()trueである場合 : get<i>(v_) = get<i>(x.v_)
    • それ以外の場合 : v_.emplace<i>(get<i>(x.v_))

    戻り値

    *this

    バージョン

    言語

    • C++20

    処理系

    参照