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

履歴 編集

function
<ranges>

std::ranges::join_view::コンストラクタ(C++20)

join_view()
  requires default_initializable<V> = default; // (1) C++20

constexpr explicit join_view(V base);          // (2) C++20

概要

join_viewオブジェクトを構築する。

効果

#include <iostream>
#include <ranges>
#include <vector>
#include <string>

int main() {
  std::vector<std::string> words = {"hello", "world", "join"};

  std::ranges::join_view view{words};
  for (char c : view) {
    std::cout << c;
  }
  std::cout << std::endl;
}

出力

helloworldjoin

バージョン

言語

  • C++20

処理系