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/../algorithm/../iterator/indirect_result_t.html below:

std::indirect_result_t - cppreference.com

The alias template indirect_result_t obtains the result type of invoking an invocable type F on the result of dereferencing indirectly_readable types Is....

[edit] Template parameters F - an invocable type Is - indirectly readable types that are dereferenced to arguments [edit] Example
#include <iterator>
#include <type_traits>
 
struct Fn
{
    long operator()(const int&);
    int operator()(int&&);
    short operator()(int, int) const;
    auto operator()(const float) -> int&;
    void operator()(int[8]);
};
 
static_assert(
    std::is_same_v<std::indirect_result_t<Fn, const int*>, long> and
    std::is_same_v<std::indirect_result_t<Fn, std::move_iterator<int*>>, int> and
    std::is_same_v<std::indirect_result_t<const Fn, int*, int*>, short> and
    std::is_same_v<std::indirect_result_t<Fn, float*>, int&> and
    std::is_same_v<std::indirect_result_t<Fn, int**>, void>
);
 
int main() {}
[edit] See also

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