deductiongu...::split_view(3)
π NAME π
okay so bestie, this page is deductiongu...::split_view(3) from the C++ Standard Libary, and the official NAME is literally:
deductionguidesforstd::ranges::split_view - deductionguidesforstd::ranges::split_view
not me pointing out itβs the same on both sides ππ itβs giving redundant but make it fashion.
β¨ Synopsis β¨
these deduction guides are provided for split_view to allow deduction from a range and a delimiter. periodt. two guides, both (since C++20), both iconic π
template< class R, class P >
split_view( R&&, P&& )
(1) (since C++20)
-> split_view<views::all_t<R>, views::all_t<P>>;
template< ranges::input_range R >
split_view( R&&, ranges::range_value_t<R> )
(2) (since C++20)
-> split_view<views::all_t<R>,
ranges::single_view<ranges::range_value_t<R>>>;
- the delimiter is a range of elements.
- the delimiter is a single element.
π Example π
run this code, itβs right here and it ate:
// Run this code
#include <ranges>
#include <string_view>
#include <type_traits>
using std::operator""sv;
int main() {
std::ranges::split_view w1{"a::b::c"sv, "::"sv};
static_assert(std::is_same_v<
decltype(w1),
std::ranges::split_view<std::string_view, std::string_view>>);
std::ranges::split_view w2{"x,y,z"sv, ','};
static_assert(std::is_same_v<
decltype(w2),
std::ranges::split_view<std::string_view,
std::ranges::single_view<char>>>);
}
mwah π this page came from http://cppreference.com and itβs dated 2024.06.10 β bye bestie, go deduce something cute! π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms