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>

           ^~~~~~~~~~~~~~~

1 Answer 1

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;
1
  • bloody things can't contain capitals either. must be all lowercase
    – ekkis
    May 29, 2019 at 3:42

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .