how to resolve Error C2440 'initializing': cannot convert from '_Ty' to '_Objty'

정경섭·2023년 6월 30일
0
post-custom-banner

This issue is on these lines:

vector<int> temp(subsets_a.begin(), subsets_a.end());
temp.insert(temp.end(),subsets_b.begin(), subsets_b.end());

Here temp is of type vector<int>, but subsets_a and subsets_b are of type vector<vector<int>>.
Since the value types are int and vector<int> respectively, they don't match, and so this doesn't compile. Depending on what you need, either make temp a vector<vector<int>>, or copy the individual ints in each vector of subsets_a and subsets_b into temp.

profile
Keep Building
post-custom-banner

0개의 댓글