mutation_partition: make for_each_cell() accessible outside source file

for_each_cell() const already can be used from any place in the code,
allow the same with non-const version.
This commit is contained in:
Paweł Dziepak
2017-01-24 22:47:58 +00:00
parent bf60b7844b
commit b6564651e4
2 changed files with 11 additions and 14 deletions

View File

@@ -1019,19 +1019,6 @@ void row::for_each_cell(Func&& func, Rollback&& rollback) {
}
}
template<typename Func>
void row::for_each_cell(Func&& func) {
if (_type == storage_type::vector) {
for (auto i : bitsets::for_each_set(_storage.vector.present)) {
func(i, _storage.vector.v[i]);
}
} else {
for (auto& cell : _storage.set) {
func(cell.id(), cell.cell());
}
}
}
void
row::apply_reversibly(const column_definition& column, atomic_cell_or_collection& value) {
static_assert(std::is_nothrow_move_constructible<atomic_cell_or_collection>::value

View File

@@ -194,7 +194,17 @@ public:
// Calls Func(column_id, atomic_cell_or_collection&) for each cell in this row.
// noexcept if Func doesn't throw.
template<typename Func>
void for_each_cell(Func&&);
void for_each_cell(Func&& func) {
if (_type == storage_type::vector) {
for (auto i : bitsets::for_each_set(_storage.vector.present)) {
func(i, _storage.vector.v[i]);
}
} else {
for (auto& cell : _storage.set) {
func(cell.id(), cell.cell());
}
}
}
template<typename Func>
void for_each_cell(Func&& func) const {