Yet another option would be std::accumulate. If the result type and the input std::vector element type were the same, you could instead use a (more efficient) std::reduce. However, in this case you need to (sort of) accumulate size_ts (indices pointing into a std::vector of bools) into a bool result:
#include <iostream>
#include <numeric>
#include <vector>
int main() {
const std::vector<bool> bools{true, true, false, true, true};
const std::vector<size_t> i1{1, 4, 3, 0}; // true && true && true && true
const std::vector<size_t> i2{0, 2, 4, 3}; // true && false && true && true
const auto and_by_idx{
[&bools](bool acc, size_t idx) { return acc && bools[idx]; }};
std::cout << std::boolalpha
<< std::accumulate(i1.begin(), i1.end(), true, and_by_idx) << '\n'
<< std::accumulate(i2.begin(), i2.end(), true, and_by_idx) << '\n';
}
I wouldn’t call any of the C++ solutions idiomatic though. Some other languages have shorter and more elegant ways to express this, like Python and its all().
bools = (True, True, False, True, True)
i1 = (1, 4, 3, 0) # True && True && True && True
i2 = (0, 2, 4, 3) # True && False && True && True
print(all(bools[i] for i in i1))
print(all(bools[i] for i in i2))