Skip to content

[DebugAlign] Provide min() and max() overloads.

Jö Fahlke requested to merge debugalign-overload-min-max into master

A superficial reading of the standard's LessThanComparable requirement may suggest that we could actually use std::min() and std::max(). But as it turns out this isn't all that clear, see https://cplusplus.github.io/LWG/issue2114. libc++ chose LessThanComparable in a way that requires the result of the comparison to be implicitly convertible to bool, which we cannot guarantee as we do not want the debug type the automatically decay into its underlying type in all kinds of contexts. So we go with the alternative route of overloading min() and max().

Adresses: dune-istl#50 (closed)

Merge request reports