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 | |
parent | 1e0b5488cdce503f4d970e8163823bba9126aedc (diff) | |
download | ydb-f9f914a9d510572fa0d68959aaea41be5839ff3d.tar.gz |
Restoring authorship annotation for <evelkin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util')
-rw-r--r-- | util/generic/function.h | 32 | ||||
-rw-r--r-- | util/generic/typetraits.h | 12 |
2 files changed, 22 insertions, 22 deletions
diff --git a/util/generic/function.h b/util/generic/function.h index 62fa84e0cb..8a0efde4b1 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(); +} diff --git a/util/generic/typetraits.h b/util/generic/typetraits.h index d165bd1a06..8a47789547 100644 --- a/util/generic/typetraits.h +++ b/util/generic/typetraits.h @@ -238,27 +238,27 @@ struct TPodTraits<std::pair<T1, T2>> { template <class T> struct TIsPointerToConstMemberFunction: std::false_type { }; - + template <class R, class T, class... Args> struct TIsPointerToConstMemberFunction<R (T::*)(Args...) const>: std::true_type { }; - + template <class R, class T, class... Args> struct TIsPointerToConstMemberFunction<R (T::*)(Args...) const&>: std::true_type { }; - + template <class R, class T, class... Args> struct TIsPointerToConstMemberFunction<R (T::*)(Args...) const&&>: std::true_type { }; - + template <class R, class T, class... Args> struct TIsPointerToConstMemberFunction<R (T::*)(Args..., ...) const>: std::true_type { }; - + template <class R, class T, class... Args> struct TIsPointerToConstMemberFunction<R (T::*)(Args..., ...) const&>: std::true_type { }; - + template <class R, class T, class... Args> struct TIsPointerToConstMemberFunction<R (T::*)(Args..., ...) const&&>: std::true_type { }; |