Skip to content

Add overload() and orderedOverload()

Carsten Gräser requested to merge feature/overloadset into master

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::.

Merge request reports