I would like to initalize a vector of pairs with some hard-coded values, I tried using different solutions but I keep getting compilation error. My code looks like this:
std::vector<std::pair<cv::HOGDescriptor, std::ifstream> > hogs_files = { std::make_pair(hog, file), std::make_pair(hog2, file2), std::make_pair(hog3, file3), std::make_pair(hog4, file4), std::make_pair(hog5, file5), std::make_pair(hog6, file6), std::make_pair(hog7, file7), std::make_pair(hog8, file8) }; and the error I've got is:
Error C2440 '<function-style-cast>': cannot convert from 'initializer list' to '_Mypair' Thank you for answers.
{{and}}, butstd::ifstreamis not copy-constructable and therefore can't be used instd::pair.