#include <vector>
using namespace std;
int main()
{
int arr[5] = { 1,2,3,4,5 };
vector<int> vec(arr, arr + 5);
return 0;
}
错误信息:
no instance of constructor "std::vector<_Ty, _Alloc>::vector [with _Ty=int, _Alloc=std::allocator]" matches the argument list
版本:
Visual Studio 2022 Community