std::ranges::lazy_split_view<V,Pattern>::base
cppreference.net에서
constexpr V base() const& requires std::copy_constructible<V>;
|
(1) | (C++20부터) |
constexpr V base() &&;
|
(2) | (C++20부터) |
기반이 되는 뷰의 복사본을 반환합니다base_.
1) 기반이 되는 뷰로부터 결과를 복사 생성합니다
base_.2) 기반이 되는 뷰로부터 결과를 이동 생성합니다
base_.반환값
기본 뷰의 복사본
base_
.
예제
이 코드 실행
#include <iostream> #include <ranges> #include <string_view> void print(std::string_view rem, auto const& r, std::string_view post = "\n") { for (std::cout << rem; auto const& e : r) std::cout << e; std::cout << post; } int main() { constexpr std::string_view keywords{ "this,..throw,..true,..try,.." }; constexpr std::string_view pattern{",.."}; constexpr std::ranges::lazy_split_view lazy_split_view{keywords, pattern}; print("base() = [", lazy_split_view.base(), "]\n" "substrings: "); for (auto const& split: lazy_split_view) print("[", split, "] "); }
출력:
base() = [this,..throw,..true,..try,..] substrings: [this] [throw] [true] [try] []
참고 항목
|
기본(적응된) 뷰의 복사본을 반환합니다
(
std::ranges::split_view<V,Pattern>
의 public 멤버 함수)
|