Namespaces
Variants

std::ranges::concat_view<Views...>:: begin

From cppreference.net
Ranges library
Range adaptors
constexpr /*iterator*/ < false > begin ( )
requires ( ! ( /*simple-view*/ < Views > && ... ) ) ;
(1) (C++26 起)
constexpr /*iterator*/ < true > begin ( ) const

requires ( ranges:: range < const Views > && ... ) &&

/*concatable*/ < const Views... > ;
(2) (C++26 起)

返回指向 concat_view 起始位置的 迭代器

1) 等价于 iterator  < false > it ( this, std:: in_place_index < 0 > ,
ranges:: begin ( std :: get < 0 > ( views_  ) ) ) ;
it. template satisfy  < 0 > ( ) ;
return it ;
2) 等价于 iterator  < true > it ( this, std:: in_place_index < 0 > ,
ranges:: begin ( std :: get < 0 > ( views_  ) ) ) ;
it. template satisfy  < 0 > ( ) ;
return it ;

返回值

如上所述。

示例

初步版本可在 Compiler Explorer 上查看。

#include <ranges>
#include <string_view>
using namespace std::literals;
int main()
{
    static constexpr auto c = {"🐱", "🐶"};
    static constexpr auto a = {"🤡"sv};
    static constexpr auto t = {"💚"sv};
    static constexpr auto cat{std::views::concat(c, a, t)};
    static_assert(*cat.begin() == "\U0001F431" and
                  cat.begin()[1] == "🐶" and
                  *(cat.begin() + 2) == "\N{CLOWN FACE}");
}

参见

返回指向末尾的迭代器或哨兵
(公开成员函数)
返回指向范围起始位置的迭代器
(定制点对象)