From 77fabf47e1c5970457f48493307784f4ca009e3b Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 26 Jan 2022 17:15:26 -0700 Subject: [PATCH] Move a few generic names into a namespace that explains what things refer to. --- include/deal.II/base/template_constraints.h | 75 +++++++++++---------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/include/deal.II/base/template_constraints.h b/include/deal.II/base/template_constraints.h index 4f6efbbd86..3d9673bf6d 100644 --- a/include/deal.II/base/template_constraints.h +++ b/include/deal.II/base/template_constraints.h @@ -31,51 +31,58 @@ DEAL_II_NAMESPACE_OPEN // Fundamentals, ISO/IEC TS 19568:2017 namespace internal { - template - using void_t = void; - - // base class for nonesuch to inherit from so it is not an aggregate - struct nonesuch_base - {}; - - // primary template handles all types not supporting the archetypal Op - template - class Op, - class... /*Args*/> - struct detector + namespace SupportsOperation { - using value_t = std::false_type; - using type = Default; - }; + template + using void_t = void; + + // base class for nonesuch to inherit from so it is not an aggregate + struct nonesuch_base + {}; + + // primary template handles all types not supporting the archetypal Op + template + class Op, + class... /*Args*/> + struct detector + { + using value_t = std::false_type; + using type = Default; + }; - // specialization recognizes and handles only types supporting Op - template class Op, class... Args> - struct detector>, Op, Args...> - { - using value_t = std::true_type; - using type = Op; - }; + // specialization recognizes and handles only types supporting Op + template class Op, class... Args> + struct detector>, Op, Args...> + { + using value_t = std::true_type; + using type = Op; + }; - struct nonesuch : private internal::nonesuch_base - { - ~nonesuch() = delete; - nonesuch(nonesuch const &) = delete; - void - operator=(nonesuch const &) = delete; - }; + struct nonesuch : private nonesuch_base + { + ~nonesuch() = delete; + nonesuch(nonesuch const &) = delete; + void + operator=(nonesuch const &) = delete; + }; + + } // namespace SupportsOperation template class Op, class... Args> - using detected_or = internal::detector; + using detected_or = + internal::SupportsOperation::detector; template