From 586708721b281ee66d2db8b45319345f583f575b Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Fri, 27 Oct 2017 13:59:25 +0200 Subject: [PATCH] Variadic extraction of RankInfo:: rank and map. --- include/deal.II/base/patterns.h | 36 +++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index 2066fc155c..184d2a352b 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -1441,6 +1441,34 @@ namespace Patterns namespace internal { + // Helper function for list_rank + template + constexpr int max_list_rank() + { + return RankInfo::list_rank; + }; + + template + constexpr int max_list_rank() + { + return std_cxx14::max(RankInfo::list_rank, + max_list_rank()); + }; + + // Helper function for map_rank + template + constexpr int max_map_rank() + { + return RankInfo::map_rank; + }; + + template + constexpr int max_map_rank() + { + return std_cxx14::max(RankInfo::map_rank, + max_map_rank()); + }; + // Rank of vector types template struct RankInfo::value>::type> { static constexpr int list_rank = - std_cxx14::max(internal::RankInfo::list_rank, - RankInfo::list_rank) + - 1; + max_list_rank() + 1; static constexpr int map_rank = - std_cxx14::max(internal::RankInfo::map_rank, - RankInfo::map_rank) + - 1; + max_map_rank() + 1; }; // Rank of Tensor types -- 2.39.5