diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-05-21 09:18:07 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-05-21 09:18:07 +0100 |
commit | 4c87703334b12bcb0981547591463be0bd58b1ae (patch) | |
tree | cb984b646cc2564aeb1d90c0b10416e882c88176 /src/libutil/cxx/util.hxx | |
parent | c0176958950a91cec4e1a2b1bc0f898ca9bf5c1c (diff) | |
download | rspamd-4c87703334b12bcb0981547591463be0bd58b1ae.tar.gz rspamd-4c87703334b12bcb0981547591463be0bd58b1ae.zip |
[Rework] Move entities/tags handling
Diffstat (limited to 'src/libutil/cxx/util.hxx')
-rw-r--r-- | src/libutil/cxx/util.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/cxx/util.hxx b/src/libutil/cxx/util.hxx index a61399977..2b8ddfe3d 100644 --- a/src/libutil/cxx/util.hxx +++ b/src/libutil/cxx/util.hxx @@ -19,6 +19,7 @@ #pragma once #include <memory> +#include <array> /* * Common C++ utilities @@ -53,6 +54,16 @@ struct shared_ptr_hash { } }; +/* + * Creates std::array from a standard C style array with automatic size calculation + */ +template <typename V, typename... T> +constexpr auto array_of(T&&... t) -> std::array<V, sizeof...(T)> +{ + return {{ std::forward<T>(t)... }}; +} + + } #endif //RSPAMD_UTIL_HXX |