Skip to content

map and set initializer_list constructors #175

@jeaye

Description

@jeaye

Hello! Thank you so much for making immer. I see that arrays and vectors support initialize_list ctors. Is there any reason why maps and sets don't? I haven't found any docs or issues suggesting a reason, so it could be an oversight?

// This works.
immer::vector<int> v{ 1, 2, 3, 4 };

// These do not compile.
immer::set<int> s{ 1, 2, 3, 4 };
immer::map<int, int> m{ {1, 2}, {3, 4} };

// All of these work.
std::vector<int> v{ 1, 2, 3, 4 };
std::set<int> s{ 1, 2, 3, 4 };
std::map<int, int> m{ {1, 2}, {3, 4} };

Activity

arximboldi

arximboldi commented on Apr 21, 2021

@arximboldi
Owner

It is simply a missing feature. I've been wanting to add it when I add map transients, which is top of the TODO-list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jeaye@arximboldi

        Issue actions

          map and set initializer_list constructors · Issue #175 · arximboldi/immer