Skip to content

make_pair seems broken? #25

@mcourteaux

Description

@mcourteaux

Consider:

std::string a = "sd";
unsigned int b = 5;

auto pair = tinystl::make_pair(a, b);

Now, the pair variable seems to be of type tinystl::pair<const std::string, unsigned int>.
As far as I can tell, the const in front of the string is very inconvenient (and I believe wrong, according to the spec).

The std implementation has some special stuff going on with unwrap_ref_decay_t, which I believe takes care of dropping the const: https://en.cppreference.com/w/cpp/utility/pair/make_pair

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions