3

I'm trying to shift my contract and build it with the latest CDT, v1.3.2.

The transition docs say to use the new ""_n name constructor but it doesn't appear to be working.

I have:

typedef multi_index<"settings"_n, setting, 
    indexed_by<"setting_key"_n, const_mem_fun<setting, uint64_t, &setting::by_setting_key>>
> setting_index;

But I get a compile error:

error: non-type template argument is not a constant expression

indexed_by<"setting_key"_n, const_mem_fun>

           ^~~~~~~~~~~~~~~
4

Figured it out.

In case anyone else has this issue. Looks like the index name can't have an underscore in it.

Changed to:

typedef multi_index<"settings"_n, setting, 
    indexed_by<"settingkey"_n, const_mem_fun<setting, uint64_t, &setting::by_setting_key>>
> setting_index;
|improve this answer|||||
  • bloody things can't contain capitals either. must be all lowercase – ekkis May 29 '19 at 3:42

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.