I keep getting an "error: constexpr variable 'x' must be initialized by a constant expression" from previously used working code
I keep getting an "error: constexpr variable 'x' must be initialized by a constant expression" from previously used working code
这几天我一直在摸不着头脑。逐步删除和添加行并在每个阶段重新编译,直到它中断。
ACTION act1(name nm, uint64_t amount);
ACTION act2(name nm, uint64_t signing_value);
ACTION receiverand(name nm, checksum256& random_value);
ACTION act4(name nm, uint64_t stake);
ACTION act5(uint64_t num);
ACTION act6(name nm);
using act1_action = action_wrapper<"act1"_n, &project::act1>;
using act2_action = action_wrapper<"act2"_n, &project::act2>;
using receiverand_action = action_wrapper<"receiverand"_n, &project::receiverand>;
using act4_action = action_wrapper<"act4"_n, &project::act4>;
using act5_action = action_wrapper<"act5"_n, &project::act5>;
using act6_action = action_wrapper<"act6"_n, &project::act6>;
添加act6时出现问题。我有 act4,一切正常。所以我添加了 5 和 6 然后错误被抛出所以我返回添加 5 并且一切都还好。
这是我不断收到的错误
error: constexpr variable 'x' must be initialized by a constant expression
constexpr auto x =
eosio::name{std::string_view{eosio::detail::to_const_char_arr<Str...>::value,
sizeof...(Str)}};
note: in instantiation of function template specialization 'operator""_n<char, 'a',
'c', 't', '6'>' requested here
using act6_action = action_wrapper<"act6"_n, &project::act6>;
note: non-constexpr function 'check' cannot be used in a constant expression
eosio::check( false, "character is not in allowed character set for names" );
名称似乎不能包含字符 '6'
,只能包含 '1'
至 '5'
。
Action names [...] May contain: a-z, 1-5, or .
https://eosio.stackexchange.com/questions/7/what-are-naming-rules-for-actions-tables-and-contracts
这几天我一直在摸不着头脑。逐步删除和添加行并在每个阶段重新编译,直到它中断。
ACTION act1(name nm, uint64_t amount);
ACTION act2(name nm, uint64_t signing_value);
ACTION receiverand(name nm, checksum256& random_value);
ACTION act4(name nm, uint64_t stake);
ACTION act5(uint64_t num);
ACTION act6(name nm);
using act1_action = action_wrapper<"act1"_n, &project::act1>;
using act2_action = action_wrapper<"act2"_n, &project::act2>;
using receiverand_action = action_wrapper<"receiverand"_n, &project::receiverand>;
using act4_action = action_wrapper<"act4"_n, &project::act4>;
using act5_action = action_wrapper<"act5"_n, &project::act5>;
using act6_action = action_wrapper<"act6"_n, &project::act6>;
添加act6时出现问题。我有 act4,一切正常。所以我添加了 5 和 6 然后错误被抛出所以我返回添加 5 并且一切都还好。 这是我不断收到的错误
error: constexpr variable 'x' must be initialized by a constant expression
constexpr auto x =
eosio::name{std::string_view{eosio::detail::to_const_char_arr<Str...>::value,
sizeof...(Str)}};
note: in instantiation of function template specialization 'operator""_n<char, 'a',
'c', 't', '6'>' requested here
using act6_action = action_wrapper<"act6"_n, &project::act6>;
note: non-constexpr function 'check' cannot be used in a constant expression
eosio::check( false, "character is not in allowed character set for names" );
名称似乎不能包含字符 '6'
,只能包含 '1'
至 '5'
。
Action names [...] May contain: a-z, 1-5, or .
https://eosio.stackexchange.com/questions/7/what-are-naming-rules-for-actions-tables-and-contracts