Skip to content
Snippets Groups Projects
Forked from Core Modules / dune-common
Source project has a limited visibility.
Carsten Gräser's avatar
Carsten Gräser authored
Add overload() and orderedOverload()

These helper functions allow to create overload sets from lambdas.
E.g. one can merge to lambdas for different argument types into
one overload set in order to easily implement type-specific behaviour
when looping over a tuple.

While the result of overload(f1, f2,...) will pick the best match
for a given set of arguments, orderedOverload(f1,f2,...) will pick
the first match which allows to prevent ambiguity.

This functionality is proposed for the standard in P0051R2
(open-std.org/JTC1/SC22/WG21/docs/papers/2016/p0051r2.pdf).
There overload(...) is proposed and an upcomming proposal
with the functionality of orderedOverload(...) is announced.
Since the former is not accepted and the latter is not even written
I did explicitly implement this in Dune:: instead of Dune::Std::.

See merge request !153
cbc5dfe1
History
Name Last commit Last update