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

履歴 編集

function
<ranges>

std::ranges::as_rvalue_view::推論補助(C++23)

namespace std::ranges {
  template <class R>
  as_rvalue_view(R&&) -> as_rvalue_view<views::all_t<R>>;
}

概要

as_rvalue_viewクラステンプレートの型推論補助。

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

int main() {
  std::vector<int> v = {1, 2, 3};
  auto r = std::ranges::as_rvalue_view(v);
  for (int x : r) {
    std::cout << x << std::endl;
  }
}

出力

1
2
3

バージョン

言語

  • C++23

処理系