libkazv
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
9
static_assert(
false
,
"This is an *interface*, not an actual class in the library."
);
10
20
template
<
class
T>
21
class
Promise
22
{
23
public
:
27
using
DataT
= T;
28
42
template
<
class
Func>
43
Promise
then
(Func &&f);
44
};
Promise::then
Promise then(Func &&f)
Specify something to do after this Promise resolves.
Promise::DataT
T DataT
The type of the value this Promise will hold.
Definition:
promise.hpp:27
Promise
A Promise represents an asynchronous result that can be fetched later.
Definition:
promise.hpp:21
src
doc-interfaces
promise.hpp
Generated by
1.8.17