Workaround for MSVC std::function bug