1. without CV_EXPORTS the function will not be available for Windows users when OpenCV is built as DLL.
2. the leading underscore should probably be removed - we use underscores for external functions very very rarely, e.g. when there is already function without underscore.
3. Actually, I'd suggest to make this function internal for now. I checked that it's not used in samples and it's actually implementation-specific. If we move it inside, we could remove <pre>#include <valarray></pre> from headers.