mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Encapsulated DcOptions to an independent class.
This commit is contained in:
@@ -22,6 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
|
||||
#include "core/basic_types.h"
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
|
||||
namespace base {
|
||||
|
||||
@@ -82,6 +83,12 @@ scope_guard_helper<Lambda> scope_guard(Lambda on_scope_exit) {
|
||||
return scope_guard_helper<Lambda>(std::move(on_scope_exit));
|
||||
}
|
||||
|
||||
template <typename Container, typename T>
|
||||
inline bool contains(const Container &container, const T &value) {
|
||||
auto end = std::end(container);
|
||||
return std::find(std::begin(container), end, value) != end;
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
|
||||
// using for_const instead of plain range-based for loop to ensure usage of const_iterator
|
||||
|
Reference in New Issue
Block a user