dune-common 2.10
|
Adapter of a hybrid functor that maintains results hybrid. More...
#include <dune/common/hybridutilities.hh>
Public Member Functions | |
template<class... Args> | |
constexpr decltype(auto) | operator() (const Args &... args) const |
Adapter of a hybrid functor that keeps results hybrid. | |
Adapter of a hybrid functor that maintains results hybrid.
This adapter will return an integral constant if all of the arguments are integral constants. That's helpful to maintain the hybrid nature of a variable after a transformation. For example, applying an operator + between two integral constants will promote the result to its underlying type (e.g. std::size_t). That's inconventient since the value of the result is not encoded in the type anymore, thus, losing its hybrid attribute (maybe still being constexpr).