Not touching on the rest of what you said, but what&#x27;s so bad about min? Apart from some internal clang stuff, like odd names and macros, it looks okay - I can see what the function is doing.<p><pre><code>    &#x2F;&#x2F; min

    template &lt;class _Tp, class _Compare&gt;
    inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    const _Tp&amp;
    min(const _Tp&amp; __a, const _Tp&amp; __b, _Compare __comp)
    {
        return __comp(__b, __a) ? __b : __a;
    }

    template &lt;class _Tp&gt;
    inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    const _Tp&amp;
    min(const _Tp&amp; __a, const _Tp&amp; __b)
    {
        return _VSTD::min(__a, __b, __less&lt;_Tp&gt;());
    }

    #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

    template&lt;class _Tp, class _Compare&gt;
    inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    _Tp
    min(initializer_list&lt;_Tp&gt; __t, _Compare __comp)
    {
        return *__min_element(__t.begin(), __t.end(), __comp);
    }

    template&lt;class _Tp&gt;
    inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    _Tp
    min(initializer_list&lt;_Tp&gt; __t)
    {
        return *__min_element(__t.begin(), __t.end(), __less&lt;_Tp&gt;());
    }

    #endif  &#x2F;&#x2F; _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS</code></pre>