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
Consider:
Now, the
pairvariable seems to be of typetinystl::pair<const std::string, unsigned int>.As far as I can tell, the
constin front of the string is very inconvenient (and I believe wrong, according to the spec).The
stdimplementation has some special stuff going on withunwrap_ref_decay_t, which I believe takes care of dropping theconst: https://en.cppreference.com/w/cpp/utility/pair/make_pair