dune-common 2.9.0
Loading...
Searching...
No Matches
Static Public Attributes | List of all members
Dune::PriorityTag< priority > Struct Template Reference

Helper class for tagging priorities. More...

#include <dune/common/typeutilities.hh>

Static Public Attributes

static constexpr std::size_t value = priority
 

Detailed Description

template<std::size_t priority>
struct Dune::PriorityTag< priority >

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 with i less than k.

Template Parameters
priorityThe priority of this tag.

Member Data Documentation

◆ value

template<std::size_t priority>
constexpr std::size_t Dune::PriorityTag< priority >::value = priority
staticconstexpr

The documentation for this struct was generated from the following file: