#std-initializer-list doesn't have first, second members

1 messages · Page 1 of 1 (latest)

inland pebble
#

This is how I defined my fifo_map class that takes a std::initializer_list of a std::pair:

https://paste.ofcode.org/96ce3rQsVjJ79u4RPyf5ds

Now when I assign these to the variable as such:

inline const reactaio::internal::fifo_map<std::string, dpp::audit_type> audit_log_events{
    {"guild_update", dpp::audit_type::aut_guild_update},
    {"channel_create", dpp::audit_type::aut_channel_create},
    {"channel_update", dpp::audit_type::aut_channel_update},
    {"channel_delete", dpp::audit_type::aut_channel_delete},
    {"channel_overwrite_create", dpp::audit_type::aut_channel_overwrite_create},
    {"channel_overwrite_update", dpp::audit_type::aut_channel_overwrite_update},
    {"member_kick", dpp::audit_type::aut_member_kick},
    {"member_prune", dpp::audit_type::aut_member_prune},
    {"member_ban_add", dpp::audit_type::aut_member_ban_add},
    {"member_ban_remove", dpp::audit_type::aut_member_ban_remove},
    {"member_update", dpp::audit_type::aut_member_update},
    {"member_role_update", dpp::audit_type::aut_member_role_update},
    {"member_move", dpp::audit_type::aut_member_move},
    {}
};

I get this clangd error: In template: no member named 'first' in 'std::initializer_list<std::pair<std::basic_string<char>, dpp::audit_type>>'

I understand that this means it doesn't have that but don't initializer lists have this feature?
Based on: https://en.cppreference.com/w/cpp/utility/pair
And https://en.cppreference.com/w/cpp/utility/initializer_list

#

(I couldn't post the entire code cause even tho I had 6 characters left with the code here it told me 2000 characters were exceeded)

#

The code is horribly formatted on the site but on the IDE it looks decent

dim lodge
inland pebble
#

Yup that fixed it