MCPcopy Create free account
hub / github.com/0voice/cpp_new_features / main

Function main

cpp_17/004_tuple_apply.cpp:28–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28int main()
29{
30 // OK
31 std::cout << std::apply(add, std::pair(1, 2)) << '\n';
32
33 // Error: can't deduce the function type
34 // std::cout << std::apply(add_generic, std::make_pair(2.0f, 3.0f)) << '\n';
35
36 // OK
37 std::cout << std::apply(add_lambda, std::pair(2.0f, 3.0f)) << '\n';
38
39 // advanced example
40 std::tuple myTuple(25, "Hello", 9.31f, 'c');
41 std::cout << myTuple << '\n';
42
43}

Callers

nothing calls this directly

Calls 1

applyFunction · 0.85

Tested by

no test coverage detected