Can't compile new C++ project: 'You cannot use raw method delegates with UObjects'

You need to update Visual Studio to C++ toolchain 14.16.27023 (or later) and Windows SDK 10.0.18362.0 (or later). It is also recommended to start using VS 2019 over 2017.