const auto has_effect =
std::none_of(collections.begin(), collections.end(), [](const auto& c) { return c.get().empty(); });
- if (has_effect and (not collections.empty())) {
+ if (has_effect && (not collections.empty())) {
std::transform(collections.begin(), collections.end(), std::back_inserter(current_subset),
[](const auto& c) { return c.get().cbegin(); });
underlying_collections = std::move(collections);
{
// Termination occurs when `current_subset := the empty set`
// or if we have nothing to iterate over
- if (current_subset.empty() or underlying_collections.empty()) {
+ if (current_subset.empty() || underlying_collections.empty()) {
return;
}
for (auto j = k; j != std::numeric_limits<size_t>::max(); j--) {
// Attempt to move to the next element of the `j`th collection
- const auto& new_position = ++current_subset[j];
+ ++current_subset[j];
// If the `j`th element has reached its own end, reset it
// back to the beginning and keep moving forward
- if (new_position == underlying_collections[j].get().cend()) {
+ if (current_subset[j] == underlying_collections[j].get().cend()) {
current_subset[j] = underlying_collections[j].get().cbegin();
} else {
// Otherwise we've found the largest element which needed to