diff --git a/dune/common/CMakeLists.txt b/dune/common/CMakeLists.txt index 19995db4bc862c70081aaec90def3fa77b4989f2..6e06686fdab9f2bc35e479c1c1220ca14e51c790 100644 --- a/dune/common/CMakeLists.txt +++ b/dune/common/CMakeLists.txt @@ -76,7 +76,6 @@ install(FILES poolallocator.hh power.hh precision.hh - prioritytag.hh propertymap.hh promotiontraits.hh proxymemberaccess.hh diff --git a/dune/common/Makefile.am b/dune/common/Makefile.am index 0be92658a7af57d5c74a3eb52c8d40c74f209d62..c1dad7443b53457fa15c0e52722c5aed087953bd 100644 --- a/dune/common/Makefile.am +++ b/dune/common/Makefile.am @@ -70,7 +70,6 @@ commoninclude_HEADERS = \ poolallocator.hh \ power.hh \ precision.hh \ - prioritytag.hh \ promotiontraits.hh \ propertymap.hh \ proxymemberaccess.hh \ diff --git a/dune/common/prioritytag.hh b/dune/common/prioritytag.hh deleted file mode 100644 index 86b09f267a2961f8cc0ece23cb004558247f7701..0000000000000000000000000000000000000000 --- a/dune/common/prioritytag.hh +++ /dev/null @@ -1,55 +0,0 @@ -// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- -// vi: set et ts=4 sw=2 sts=2: -#ifndef DUNE_COMMON_PRIORITYTAG_HH -#define DUNE_COMMON_PRIORITYTAG_HH - -#include <cstddef> - -namespace Dune { - - /** - * \ingroup TypeUtilities - * - * @{ - */ - - /** - * \brief Helper class for tagging priorities. - * - * When using multiple overloads of a function - * where some are removed from the overload set - * via SFINAE, the remaining overloads may be ambiguous. - * A prototypic example would be a default overload - * that should be used if the others do not apply. - * - * By adding additional arguments of type PriorityTag<k> - * with increasing priority k to all overloads and calling - * the method with PriorityTag<m> where m is larger or equal - * to the maximal used priority, those can be made unambiguous. - * - * In this case the matching overload with highest priority - * will be used. This is achieved by the fact that PriorityTag<k> - * derives from all types PriorityTag<i> with i les than k. - * - * \tparam priority The priority of this tag. - */ - template<std::size_t priority> - struct PriorityTag : public PriorityTag<priority-1> - {}; - - /** - * \brief Helper class for tagging priorities. - * - * PriorityTag<0> does not derive from any - * other PriorityTag. - */ - template<> - struct PriorityTag<0> - {}; - - /** - * @} - */ -} - -#endif // DUNE_COMMON_PRIORITYTAG_HH diff --git a/dune/common/typeutilities.hh b/dune/common/typeutilities.hh index 80d1d1eac505644b01fd519c1949c17180d94278..03fb0cf2d7920a0ece279290c451a597cd97c723 100644 --- a/dune/common/typeutilities.hh +++ b/dune/common/typeutilities.hh @@ -3,6 +3,7 @@ #ifndef DUNE_COMMON_TYPEUTILITIES_HH #define DUNE_COMMON_TYPEUTILITIES_HH +#include <cstddef> #include <type_traits> #include <tuple> @@ -32,6 +33,46 @@ namespace Dune { + /** + * \brief Helper class for tagging priorities. + * + * \ingroup TypeUtilities + * + * When using multiple overloads of a function + * where some are removed from the overload set + * via SFINAE, the remaining overloads may be ambiguous. + * A prototypic example would be a default overload + * that should be used if the others do not apply. + * + * By adding additional arguments of type PriorityTag<k> + * with increasing priority k to all overloads and calling + * the method with PriorityTag<m> where m is larger or equal + * to the maximal used priority, those can be made unambiguous. + * + * In this case the matching overload with highest priority + * will be used. This is achieved by the fact that PriorityTag<k> + * derives from all types PriorityTag<i> with i les than k. + * + * \tparam priority The priority of this tag. + */ + template<std::size_t priority> + struct PriorityTag : public PriorityTag<priority-1> + {}; + + /** + * \brief Helper class for tagging priorities. + * + * \ingroup TypeUtilities + * + * PriorityTag<0> does not derive from any + * other PriorityTag. + */ + template<> + struct PriorityTag<0> + {}; + + + } // namespace Dune