template<class function_t, class result_t = void, class... args_t>
struct xtd::invocable< function_t, result_t, args_t >
Represents the invocable (function, method, xtd::delegate, xtd::event, std::functional) concept.
- Definition
template<class function_t, class result_t = void, class... args_t>
concept invocable = std::invocable<function_t, args_t...> && (std::is_void_v<result_t> || std::convertible_to<std::invoke_result_t<function_t, args_t...>, result_t>);
Represents the invocable (function, method, xtd::delegate, xtd::event, std::functional) concept.
Definition invocable_.hpp:47
- Header
-
- Namespace
- xtd
- Library
- xtd.core
- Examples
- The following code shows how to use xtd::invocable concept
#include <xtd/xtd>
template<class value_t>
auto result = items;
result.sort(fct);
return result;
}
int main() {
auto items =
array {8.0, 2.0, 5.0, 9.0, 4.0, 1.0, 6.0, 7.0, 10.0, 3.0};
println(
"items = {}", sort_with(items, [](
auto a,
auto b) {
return a -
b;}));
}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
@ a
The A key.
Definition console_key.hpp:88
@ b
The B key.
Definition console_key.hpp:90
auto println(FILE *file) -> void
Writes the current line terminator to the file output stream using the specified format information.
Definition println.hpp:14