0

I want to add the my multi_index in controller db.

And Finally Adding all class is set up. But When eos program initialize the database, it didn't work.

my error log :

/eos/libraries/chainbase/include/chainbase/chainbase.hpp:188:27: error: 
  type 'index_type' (aka 'int') cannot be used prior to '::' because it has no
  members
     typedef typename index_type::value_type                       value_type;

My multi_index class :

using setw_multi_index = chainbase::shared_multi_index_container<
      s_object,
      indexed_by<
          ordered_unique<tag<by_id>, member<s_object, s_object::id_type, &s_object::id>>,
          ordered_unique<tag<by_keyBox>, composite_key<s_object,
                    member<s_object, block_num_type, &s_object::blockNum>,
                    member<s_object, uint8_t, &s_object::Flags>,
                    member<s_object, std::string, &s_object::strDetKey>>>>>;

And initiate the database :

db.create<setw_multi_index>([](auto &){});

what is wrong??

1

Add struct by_keyBox; before using declaration:

struct by_keyBox;

using setw_multi_index = chainbase::shared_multi_index_container<
      s_object,
      indexed_by<
          ordered_unique<tag<by_id>, member<s_object, s_object::id_type, &s_object::id>>,
          ordered_unique<tag<by_keyBox>, composite_key<s_object,
                    member<s_object, block_num_type, &s_object::blockNum>,
                    member<s_object, uint8_t, &s_object::Flags>,
                    member<s_object, std::string, &s_object::strDetKey>>>>>;
| improve this answer | |
  • But I had already been set that.. I thought when my branch was merged, it caused the problem. So now I am solved it. Thank you for your reply! – T Eom Nov 5 '19 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.