2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Add piping and on_next, on_error, on_done, start.

This commit is contained in:
John Preston
2017-09-04 14:24:35 +03:00
parent 101fdb1fba
commit e70052e966
7 changed files with 792 additions and 112 deletions

View File

@@ -22,6 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "core/basic_types.h"
#include "base/flags.h"
#include "base/algorithm.h"
// Define specializations for QByteArray for Qt 5.3.2, because
// QByteArray in Qt 5.3.2 doesn't declare "pointer" subtype.
@@ -42,17 +43,6 @@ inline span<const char> make_span(const QByteArray &cont) {
#endif // OS_MAC_OLD
namespace base {
template <typename T, size_t N>
inline constexpr size_t array_size(const T(&)[N]) {
return N;
}
template <typename T>
inline T take(T &source) {
return std::exchange(source, T());
}
namespace internal {
template <typename D, typename T>