From a054488f8417a40e22c4e1e0f9738f705785aa9e Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 8 Oct 2024 10:58:25 +0200 Subject: Name type template parameters using CamelCase. --- src/buildtool/build_engine/base_maps/user_rule.hpp | 61 +++++++++++----------- 1 file changed, 30 insertions(+), 31 deletions(-) (limited to 'src/buildtool/build_engine/base_maps/user_rule.hpp') diff --git a/src/buildtool/build_engine/base_maps/user_rule.hpp b/src/buildtool/build_engine/base_maps/user_rule.hpp index 327d1466..c2d46420 100644 --- a/src/buildtool/build_engine/base_maps/user_rule.hpp +++ b/src/buildtool/build_engine/base_maps/user_rule.hpp @@ -41,16 +41,15 @@ namespace BuildMaps::Base { // kTriangular=true Performs triangular compare, everyone with everyone. // kTriangular=false Performs linear compare, first with each of the rest. template > -[[nodiscard]] static inline auto GetDuplicates(T_Container const& first, - T_Rest const&... rest) - -> T_Result; - -template -[[nodiscard]] static inline auto JoinContainer(T_Container const& c, + InputIterableContainer TContainer, + InputIterableContainer... TRest, + OutputIterableContainer TResult = + std::unordered_set> +[[nodiscard]] static inline auto GetDuplicates(TContainer const& first, + TRest const&... rest) -> TResult; + +template +[[nodiscard]] static inline auto JoinContainer(TContainer const& c, std::string const& sep) -> std::string; @@ -342,9 +341,9 @@ using UserRulePtr = UserRule::Ptr; namespace detail { -template -[[nodiscard]] static inline auto MaxSize(T_Container const& first, - T_Rest const&... rest) -> std::size_t { +template +[[nodiscard]] static inline auto MaxSize(TContainer const& first, + TRest const&... rest) -> std::size_t { if constexpr (sizeof...(rest) > 0) { return std::max(first.size(), MaxSize(rest...)); } @@ -352,14 +351,14 @@ template } template -static auto inline FindDuplicates(gsl::not_null const& dups, - T_First const& first, - T_Second const& second, - T_Rest const&... rest) -> void { + OutputIterableContainer TResult, + InputIterableContainer TFirst, + InputIterableContainer TSecond, + InputIterableContainer... TRest> +static auto inline FindDuplicates(gsl::not_null const& dups, + TFirst const& first, + TSecond const& second, + TRest const&... rest) -> void { ExpectsAudit(std::is_sorted(first.begin(), first.end()) and std::is_sorted(second.begin(), second.end())); std::set_intersection(first.begin(), @@ -382,13 +381,13 @@ static auto inline FindDuplicates(gsl::not_null const& dups, } // namespace detail template -[[nodiscard]] static inline auto GetDuplicates(T_Container const& first, - T_Rest const&... rest) - -> T_Result { - auto dups = T_Result{}; + InputIterableContainer TContainer, + InputIterableContainer... TRest, + OutputIterableContainer TResult> +[[nodiscard]] static inline auto GetDuplicates(TContainer const& first, + TRest const&... rest) + -> TResult { + auto dups = TResult{}; constexpr auto kNumContainers = 1 + sizeof...(rest); if constexpr (kNumContainers > 1) { std::size_t size{}; @@ -400,13 +399,13 @@ template (&dups, first, rest...); + detail::FindDuplicates(&dups, first, rest...); } return dups; } -template -[[nodiscard]] static inline auto JoinContainer(T_Container const& c, +template +[[nodiscard]] static inline auto JoinContainer(TContainer const& c, std::string const& sep) -> std::string { std::ostringstream oss{}; -- cgit v1.2.3