Attempting to keep track of an index for future use as an index in another container.
uint64_t namehash = ::eosio::string_to_uint64_t(my_name.c_str());
auto name_iter = names.find(namehash);
uint64_t next_idx = (names.begin() == names.end() ? 0 : (name_iter)->id + 1 );
if( name_iter == names.end() ){
names.emplace(_self, [&](struct nameList &a){
a.id = next_idx;
a.name = my_name;
a.hash = namehash;
});
name_iter = names.find(namehash);
}
First one registers 0
for the a.id
but the next series of registers that register seems to always be 1
.