#include <algorithm>
#include <iostream>
#include <limits>
#include <vector>

int main() {
 
	std::vector<bool> mask{0,   0,   1,   0,   1,   1,   0};
	std::vector<double> vec{7.1, 1.0, 3.2, 2.0, 1.8, 5.0, 0.0};
	std::vector<double> combined;
	
	std::transform(vec.begin(), vec.end(), mask.begin(), std::back_inserter(combined),
				   [](double v, bool mask) { return mask ? v : std::numeric_limits<double>::max(); });
	
	auto it = std::min_element(combined.begin(), combined.end());
	std::cout << "min=" << *it << "\n";
	return 0;
}