On Thursday, 6 August 2020 at 01:13:41 UTC, Adam D. Ruppe wrote:
It is very easy too... just write an ordinary function:

size_t maxSizeOf(T...)() {
        size_t max = 0;
        foreach(t; T)
                if(t.sizeof > max)
                        max = t.sizeof;
        return max;
}

pragma(msg, maxSizeOf!(int, char, long));

How does the memory usage and speed of this code compare to the variant that uses template instantiations? In general? Any experiences on this?

Reply via email to