diff options
author | evelkin <evelkin@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:25 +0300 |
commit | f9f914a9d510572fa0d68959aaea41be5839ff3d (patch) | |
tree | a9fbf49df619eef57f022218df3a1962d611cacf /util/generic/function.h | |
parent | 1e0b5488cdce503f4d970e8163823bba9126aedc (diff) | |
download | ydb-f9f914a9d510572fa0d68959aaea41be5839ff3d.tar.gz |
Restoring authorship annotation for <evelkin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/function.h')
-rw-r--r-- | util/generic/function.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/util/generic/function.h b/util/generic/function.h index 62fa84e0cb3..8a0efde4b19 100644 --- a/util/generic/function.h +++ b/util/generic/function.h @@ -82,22 +82,22 @@ struct TFunctionArgImpl { template <typename C, size_t N> using TFunctionArg = typename TFunctionArgImpl<C, N>::TResult; - -// temporary before std::apply appearance - -template <typename F, typename Tuple, size_t... I> -auto ApplyImpl(F&& f, Tuple&& t, std::index_sequence<I...>) { - return f(std::get<I>(std::forward<Tuple>(t))...); -} - -// change to std::apply after c++ 17 -template <typename F, typename Tuple> + +// temporary before std::apply appearance + +template <typename F, typename Tuple, size_t... I> +auto ApplyImpl(F&& f, Tuple&& t, std::index_sequence<I...>) { + return f(std::get<I>(std::forward<Tuple>(t))...); +} + +// change to std::apply after c++ 17 +template <typename F, typename Tuple> auto Apply(F&& f, Tuple&& t) { return ApplyImpl(f, t, std::make_index_sequence<std::tuple_size<std::decay_t<Tuple>>::value>{}); -} - -// change to std::apply after c++ 17 -template <typename F> +} + +// change to std::apply after c++ 17 +template <typename F> auto Apply(F&& f, std::tuple<>) { - return f(); -} + return f(); +} |