Namespaces
Variants
Views
Actions

std::indirectly_unary_invocable, std::indirectly_regular_unary_invocable

From cppreference.com
< cpp‎ | iterator
Revision as of 22:34, 23 July 2024 by Xmcgcg (Talk | contribs)

 
 
Iterator library
Iterator concepts
Iterator primitives
Algorithm concepts and utilities
Indirect callable concepts
indirectly_unary_invocableindirectly_regular_unary_invocable
(C++20)(C++20)  
Common algorithm requirements
(C++20)
(C++20)
(C++20)
Utilities
(C++20)
Iterator adaptors
Range access
(C++11)(C++14)
(C++14)(C++14)  
(C++11)(C++14)
(C++14)(C++14)  
(C++17)(C++20)
(C++17)
(C++17)
 
Defined in header <iterator>
std::indirectly_unary_invocable
template< class F, class I >

    concept indirectly_unary_invocable =
        std::indirectly_readable<I> &&
        std::copy_constructible<F> &&
        std::invocable<F&, std::iter_value_t<I>&> &&
        std::invocable<F&, std::iter_reference_t<I>> &&
        std::invocable<F&, std::iter_common_reference_t<I>> &&
        std::common_reference_with<
            std::invoke_result_t<F&, std::iter_value_t<I>&>,

            std::invoke_result_t<F&, std::iter_reference_t<I>>>;
(since C++20)
(until C++26)
template< class F, class I >

    concept indirectly_unary_invocable =
        std::indirectly_readable<I> &&
        std::copy_constructible<F> &&
        std::invocable<F&, std::iter_value_t<I>&> &&
        std::invocable<F&, std::iter_reference_t<I>> &&
        std::common_reference_with<
            std::invoke_result_t<F&, std::iter_value_t<I>&>,

            std::invoke_result_t<F&, std::iter_reference_t<I>>>;
(since C++26)
std::indirectly_regular_unary_invocable
template< class F, class I >

    concept indirectly_regular_unary_invocable =
        std::indirectly_readable<I> &&
        std::copy_constructible<F> &&
        std::regular_invocable<F&, std::iter_value_t<I>&> &&
        std::regular_invocable<F&, std::iter_reference_t<I>> &&
        std::regular_invocable<F&, std::iter_common_reference_t<I>> &&
        std::common_reference_with<
            std::invoke_result_t<F&, std::iter_value_t<I>&>,

            std::invoke_result_t<F&, std::iter_reference_t<I>>>;
(since C++20)
(until C++26)
template< class F, class I >

    concept indirectly_regular_unary_invocable =
        std::indirectly_readable<I> &&
        std::copy_constructible<F> &&
        std::regular_invocable<F&, std::iter_value_t<I>&> &&
        std::regular_invocable<F&, std::iter_reference_t<I>> &&
        std::common_reference_with<
            std::invoke_result_t<F&, std::iter_value_t<I>&>,

            std::invoke_result_t<F&, std::iter_reference_t<I>>>;
(since C++26)

The concepts indirectly_unary_invocable and indirectly_regular_unary_invocable specify requirements for algorithms that call (regular) unary invocables as their arguments. The key difference between these concepts and std::invocable is that they are applied to the type the I references, rather than I itself.

Notes

The distinction between indirectly_unary_invocable and indirectly_regular_unary_invocable is purely semantic.