On Thursday, 1 October 2015 at 22:37:57 UTC, Ali Çehreli wrote:
template allSame(V...)
    if (isExpressions!(V))
{
    bool impl_(V...)() {
        static if (V.length > 1) {
            foreach (i, _; V[0 .. $ - 1]) {
                if (V[i] != V[i + 1]) {
                    return false;
                }
            }

            return true;

        } else {
            return true;
        }
    }

    enum allSame = impl_!V();
}

Will proposed `static foreach` reduce number of instantiations here?

Reply via email to