# std::ranges::lazy_split_view<V,Pattern>::base

> C++ Atlas: `cppatlas.com/w/cpp/ranges/lazy_split_view/base` | Source: https://en.cppreference.com/w/cpp/ranges/lazy_split_view/base | Domain: Ranges | Standards: C++20

Returns a copy of the underlying view base_.

## Official Specification Summary (cppreference)

```cpp
constexpr V base() const& requires std::copy_constructible<V>; // (1) (since C++20)
constexpr V base() &&; // (2) (since C++20)
```

Returns a copy of the underlying view `base_`.

1) Copy constructs the result from the underlying view `base_`.

2) Move constructs the result from the underlying view `base_`.

### Return value

A copy of the underlying view `base_`.

### Example

```cpp
#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, "] ");
}
```

Output:

```text
base() = [this,..throw,..true,..try,..]
substrings: [this] [throw] [true] [try] []
```

### See also

- [`base`](https://en.cppreference.com/w/cpp/ranges/split_view/base): returns a copy of the underlying (adapted) view (public member function of `std::ranges::split_view<V,Pattern>`)

---
Attribution: content from https://en.cppreference.com/w/cpp/ranges/lazy_split_view/base (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.