std::ranges::concat_view<Views...>::concat_view - cppreference.com (original) (raw)

concat_view() = default; (1) (since C++26)
constexpr concat_view( Views... views ); (2) (since C++26)
Overload views_
(1) default-initialized
(2) initialized with std::move(views)...

[edit] Parameters

views - view objects to adapt

[edit] Notes

In order to call the default constructor, Views must be explicitly provided and all types it contains must be default-initializable.

[edit] Example

An early preview of the example is available in Compiler Explorer.

#include #include   int main() { using namespace std::ranges;   static constexpr concat_view<empty_view> concat1{}; // overload (1) static_assert(equal(concat1, views::empty));   static constexpr auto con = {'c', 'o', 'n'}; static constexpr char cat[]{'c', 'a', 't', '\0'}; static constexpr auto concat2{views::concat(con, cat)}; // overload (2) static_assert(equal(concat2, "concat")); }