libkazv
Loading...
Searching...
No Matches
promise.hpp
Go to the documentation of this file.
1/*
2 * This file is part of libkazv.
3 * SPDX-FileCopyrightText: 2021 Tusooa Zhu <tusooa@kazv.moe>
4 * SPDX-License-Identifier: AGPL-3.0-or-later
5 */
6
7#pragma once
8
9static_assert(false, "This is an *interface*, not an actual class in the library.");
10
20template<class T>
22{
23public:
27 using DataT = T;
28
42 template<class Func>
43 Promise then(Func &&f);
44};
A Promise represents an asynchronous result that can be fetched later.
Definition promise.hpp:22
T DataT
The type of the value this Promise will hold.
Definition promise.hpp:27
Promise then(Func &&f)
Specify something to do after this Promise resolves.