You can use the following implementation:
template<uint64_t A, typename B, typename... C> void clear_table(multi_index<A, B, C...>* table) {
auto it = table->begin();
while (it != table->end()) {
it = table->erase(it);
}
}
- A,B,C are template parameters of multi_index, you can look them up in multi_index.hpp. A - is a table name, B - is a struct, stored in table, C - is indices list. You don't need to pass them, you just pass a table and params will be deducted