From 47c1310af4978d726db4670c6828c59fadb89c1b Mon Sep 17 00:00:00 2001 From: khodyrev <khodyrev@yandex-team.ru> Date: Thu, 10 Feb 2022 16:49:29 +0300 Subject: Restoring authorship annotation for <khodyrev@yandex-team.ru>. Commit 1 of 2. --- util/generic/typetraits.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'util/generic/typetraits.h') diff --git a/util/generic/typetraits.h b/util/generic/typetraits.h index d165bd1a06..6b8dcfb12c 100644 --- a/util/generic/typetraits.h +++ b/util/generic/typetraits.h @@ -8,21 +8,21 @@ #include <type_traits> #include <stlfwd> -#if _LIBCPP_STD_VER >= 17 -template <bool B> -using TBoolConstant = std::bool_constant<B>; -#else +#if _LIBCPP_STD_VER >= 17 template <bool B> +using TBoolConstant = std::bool_constant<B>; +#else +template <bool B> struct TBoolConstant: std::integral_constant<bool, B> {}; -#endif +#endif -#if _LIBCPP_STD_VER >= 17 -template <class B> -using TNegation = std::negation<B>; -#else +#if _LIBCPP_STD_VER >= 17 template <class B> +using TNegation = std::negation<B>; +#else +template <class B> struct TNegation: ::TBoolConstant<!bool(B::value)> {}; -#endif +#endif namespace NPrivate { template <class... Bs> @@ -51,30 +51,30 @@ namespace NPrivate { #if _LIBCPP_STD_VER >= 17 && !defined(_MSC_VER) // Disable std::conjunction for MSVC by analogy with std::disjunction. template <class... Bs> -using TConjunction = std::conjunction<Bs...>; -#else -template <class... Bs> +using TConjunction = std::conjunction<Bs...>; +#else +template <class... Bs> struct TConjunction: ::TBoolConstant<::NPrivate::ConjunctionImpl<Bs...>()> {}; -#endif +#endif #if _LIBCPP_STD_VER >= 17 && !defined(_MSC_VER) // Disable std::disjunction for MSVC. // It reduces build time (500 -> 20 seconds) and memory consumption (20 GB -> less than 1 GB) // for some files (notably search/dssm_boosting/dssm_boosting_calcer.cpp). template <class... Bs> -using TDisjunction = std::disjunction<Bs...>; -#else -template <class... Bs> +using TDisjunction = std::disjunction<Bs...>; +#else +template <class... Bs> struct TDisjunction: ::TBoolConstant<::NPrivate::DisjunctionImpl<Bs...>()> {}; -#endif +#endif -#if _LIBCPP_STD_VER >= 17 -template <class... Bs> -using TVoidT = std::void_t<Bs...>; -#else +#if _LIBCPP_STD_VER >= 17 +template <class... Bs> +using TVoidT = std::void_t<Bs...>; +#else template <class...> using TVoidT = void; -#endif +#endif template <class T> struct TPodTraits { -- cgit v1.2.3