On Sunday, 12 March 2017 at 20:15:43 UTC, Meta wrote:
auto max(T: const U, U)(T* x, T* y) <----- Changed `ConstOf!U` to `const U`
{
        writeln("Const template");
        return *x > *y ? x : y;
}
How detailed can I be about the template specialisation? From example in the book "C++ the complete guide" we can have:

/* pointer const reference */
template<typename T>
inline T* const& max(T* const& a, T* const&b)
{
    return a* < b* ? b : a;
}

/* const reference const pointer */
template<typename T>
inline T const* const& max(T* const* const& a, T* const* const& b)
{
    ...;
}

What would be the equivalent in D?

Reply via email to