Magic SFINAE to allow nelder_mead to work on functions of tuples or of unpacked arguments.