Loading...
Searching...
No Matches
Dune::PriorityTag< priority > Struct Template Reference
Common » Utilities » Type Utilities

Helper class for tagging priorities. More...

`#include <dune/common/typeutilities.hh>`

Inheritance diagram for Dune::PriorityTag< priority >:

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

Template Parameters

  priority | The priority of this tag.

## Member Data Documentation

## value

template<std::size_t priority>

std::size_t Dune::PriorityTag< priority >::value = priority

static constexpr

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

- typeutilities.hh