AsyncFw 1.2
Async Framework is c++ runtime with timers, poll notifiers, sockets, coroutines, etc.
 
Loading...
Searching...
No Matches
function.hpp
1/*
2Copyright (c) 2026 Alexandr Kuzmuk
3
4This file is part of the AsyncFw project. Licensed under the MIT License.
5See {Link: LICENSE file https://mit-license.org} in the project root for full license information.
6*/
7
8#pragma once
9
10namespace AsyncFw {
11template <typename... Args>
12struct AbstractFunction {
13 virtual void operator()(Args...) = 0;
14 virtual ~AbstractFunction() = default;
15};
16template <typename... Args>
17struct FunctionArgs {
18 template <typename T>
19 struct Function : public AbstractFunction<Args...> {
20 void operator()(Args... args) override { f(args...); }
21 Function(T &_f) : f(std::move(_f)) {}
22
23 private:
24 T f;
25 };
26};
27} // namespace AsyncFw