11 ms·
I'd still take the traditional solution (https://godbolt.org/z/K5hWqezMP https://godbolt.org/z/K5hWqezMP) over the latter one (https://godbolt.org/z/jaWMM491M h
by MontagFTB 5y ago
I'd still take the traditional solution (https://godbolt.org/z/K5hWqezMP https://godbolt.org/z/K5hWqezMP) over the latter one (https://godbolt.org/z/jaWMM491M https://godbolt.org/z/jaWMM491M). The latter solution requires a traditional check at the tail end of it, so the compiler appears to include the traditional implementation in the latter's solution anyways.
Unless this is a significant bottleneck for your application, the latter does not seem practical, and a lot of profiling would have to go into justifying the latter code (which would only be worthwhile if, as I said, this were a significant bottleneck.)