From: Luca Heltai Date: Fri, 27 Oct 2017 11:59:25 +0000 (+0200) Subject: Variadic extraction of RankInfo:: rank and map. X-Git-Tag: v9.0.0-rc1~848^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=586708721b281ee66d2db8b45319345f583f575b;p=dealii.git Variadic extraction of RankInfo:: rank and map. --- 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