A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/error_code/../../ranges/subrange/subrange.html below:

std::ranges::subrange<I,S,K>::subrange - cppreference.com

(1) (since C++20)

constexpr subrange( /*convertible-to-non-slicing*/<I> auto i, S s )
    requires (!/*StoreSize*/);

(2) (since C++20) constexpr subrange( /*convertible-to-non-slicing*/<I> auto i, S s,

                    /*make-unsigned-like-t*/<std::iter_difference_t<I>> n )

    requires (K == ranges::subrange_kind::sized);
(3) (since C++20) (4) (since C++20) (5) (since C++20)

Constructs a subrange.

For the definitions of /*make-unsigned-like-t*/ and /*different-from*/, see make-unsigned-like-t and different-from respectively.

2)

If

[is)

is not a

valid range

, the behavior is undefined.

3)

If any of the following conditions is satisfied, the behavior is undefined:

[edit] Parameters i - iterator that denotes the beginning of the range s - sentinel that denotes the end of the range r - range n - size hint, must be equal to the size of the range [edit] Example [edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior P2393R1 C++20 for overload (4), size_ might be initialized with ranges::size(r), but it is
not always implicitly convertible to the corresponding unsigned-integer-like type made the
conversion explicit

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4