From 7987997df37b4e3ef6e13cb13253a14637e9b6c8 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Tue, 18 Jul 2017 22:22:52 +0200 Subject: [PATCH] Made all stl containers and map available. --- include/deal.II/base/patterns_tools.h | 131 +++++++++++++++++--------- 1 file changed, 89 insertions(+), 42 deletions(-) diff --git a/include/deal.II/base/patterns_tools.h b/include/deal.II/base/patterns_tools.h index 631de078ef..584a18ca7e 100644 --- a/include/deal.II/base/patterns_tools.h +++ b/include/deal.II/base/patterns_tools.h @@ -31,8 +31,22 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + DEAL_II_NAMESPACE_OPEN @@ -72,7 +86,7 @@ namespace PatternsTools * compatible with the List type. Adding more compatible types is a matter * of adding a specialization of this struct for the given type. */ - template + template struct RankInfo { typedef std::integral_constant::type vector_rank_type; @@ -192,41 +206,76 @@ namespace PatternsTools } }; + //specialize a type for all of the STL containers and maps + namespace internal + { + template struct is_stl_container:std::false_type {}; + template struct is_stl_container> :std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + template struct is_stl_container>:std::true_type {}; + + template struct is_stl_map:std::false_type {}; + template struct is_stl_map>:std::true_type {}; + template struct is_stl_map>:std::true_type {}; + template struct is_stl_map>:std::true_type {}; + template struct is_stl_map>:std::true_type {}; + } + + //type trait to use the implementation type traits as well as decay the type + template struct is_stl_container + { + static constexpr bool const value = internal::is_stl_container>::value; + }; + + + template struct is_stl_map + { + static constexpr bool const value = internal::is_stl_map>::value; + }; + + // Rank of vector types - template