suppose I have a table:
struct [[eosio::table]] _stuff {
symbol curr;
// other stuff
uint64_t primary_key() const { return curr.code().raw(); }
};
typedef eosio::multi_index<name("stuff"), _stuff> stuff;
which I want to iterate through, passing the iterator to a function for encapsulation of business logic:
stuff st(_self, _self.value);
for (auto &o : st) {
do_biz_stuff(o);
}
how do I declare the function? I need an iterator but cannot declare it as auto
:
void do_biz_stuff(auto o) { ... }
as the compiler pukes with:
error: 'auto' not allowed in function prototype
and trying the standard iterator requires a "template arguments":
void do_biz_stuff(std::iterator o) { ... }
here's the actual error:
use of class template 'iterator' requires template arguments; argument deduction not allowed in function prototype
what is the correct incantation I need to issue to make this work?