dune-common 2.9.0
|
Tag used to force late-binding lookup in Dune::Simd::Overloads. More...
Tag used to force late-binding lookup in Dune::Simd::Overloads.
This tag is used by functions in Dune::Simd
to make argument-dependent lookups (ADL) for functions in Dune::Simd::Overloads
. The property of ADL that is used here is that it binds the names of functions late, i.e. at the time of instantiation, while all other lookups bind early, i.e. at the time when the function call is parsed. Using late binding enables a function foo()
to find a functions Overloads::foo()
that has been declared only after foo()
itself has been defined:
using
.ADLTag<i>
derives from ADLTag<i-1>
. Thus it is possible to prioritize overloads by choosing an appropriate i
. The following values for i
are predefined:
i==0,1
: these are reserved for the defaults.i==2,3
: these are reserved for the implementation for standard types.i==5,6
: these should normally be used by other implementationsThe lower priority should be used by default. The higher priority can be used by an implementation to resolve ambiguities, e.g. between an overload with a by-value argument and an overload with an lvalue-reference argument.
The following priorities should not normally be used. However, they may sometimes be necessary:
i==4
: override standard implementation, but prefer other implementationsi==7
: try to override other implementationsi==7
is the highest supported priority.
The second (bool) template argument is to make writing abstraction implementations that use SFINAE to remove (some of) their functions from the overload set more concise. ADLTag<i,false>
is not defined, so instead of
you may write the equivalent