Changeset View
Changeset View
Standalone View
Standalone View
agents/unifiedmailboxagent/utils.h
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #ifndef UTILS_H_ | 20 | #ifndef UTILS_H_ | ||
21 | #define UTILS_H_ | 21 | #define UTILS_H_ | ||
22 | 22 | | |||
23 | #include <functional> | 23 | #include <functional> | ||
24 | #include <QHash> | 24 | #include <QHash> | ||
25 | #include <QString> | 25 | #include <QString> | ||
26 | 26 | | |||
27 | #include <experimental/optional> | | |||
28 | namespace stdx { | | |||
29 | // Injects content of std::experimental namespace into "exp" namespace. | | |||
30 | // C++ is magical. | | |||
31 | using namespace std::experimental; | | |||
32 | } | | |||
33 | | ||||
34 | template<typename T> | 27 | template<typename T> | ||
35 | inline QList<T> setToList(QSet<T> &&set) | 28 | inline QList<T> setToList(QSet<T> &&set) | ||
36 | { | 29 | { | ||
37 | QList<T> rv; | 30 | QList<T> rv; | ||
38 | rv.reserve(set.size()); | 31 | rv.reserve(set.size()); | ||
39 | std::copy(set.cbegin(), set.cend(), std::back_inserter(rv)); | 32 | std::copy(set.cbegin(), set.cend(), std::back_inserter(rv)); | ||
40 | return rv; | 33 | return rv; | ||
41 | } | 34 | } | ||
Show All 32 Lines |