48 auto max_it = std::max_element( indices.begin(), indices.end() );
49 if( max_it == indices.end() ) {
50 return std::vector<bool>( size,
false );
52 size_t target_size = *max_it + 1;
54 if( target_size > size ) {
55 throw std::invalid_argument(
56 "Cannot use make_bool_vector_from_indices() with size " +
std::to_string( size ) +
57 " that is smaller than required to include the larged index " +
58 std::to_string( *max_it ) +
" in the list of indices (zero-based)."
66 auto result = std::vector<bool>( target_size,
false );
67 for(
auto const& idx : indices ) {
68 assert( idx < result.size() );