I want to set a group vector as a secondary index in the user smart contract. group is the list of groups. Following is the changes I am doing:
struct [[eosio::table]] usertable {
name key;
std::string username;
std::string contact;
std::vector<name> group;
uint64_t primary_key() const { return key.value;}
uint64_t get_secondary_1() const { return group[value];}
};
typedef eosio::multi_index<"users"_n, usertable,indexed_by<"bygroup"_n, const_mem_fun<usertable, std::vector<name>, &usertable::get_secondary_1>>> user_index;
Its giving error
error: value of type 'uint64_t (user::usertable::)() const' is not implicitly convertible to 'std::__1::vector > (user::usertable::)() const' typedef eosio::multi_index<"users"_n, usertable,indexed_by<"bygroup"_n, const_mem_fun, &usertable::get_secondary_1>>> user_index;
I am not getting exactly how to give a vector of name type list as a secondary index. Please help and guide.
group
? eosio allows only 5 types of secondary indices: uint64_t, uint128_t, checksum256, double, long double.