What is the purpose of std::make_pair vs the constructor of std::pair?
What is the purpose of std::make_pair? Why not just do std::pair<int, char>(0, ‘a’)? Is there any difference between the two methods? 7 Answers 7
What is the purpose of std::make_pair? Why not just do std::pair<int, char>(0, ‘a’)? Is there any difference between the two methods? 7 Answers 7
I’m interested: What is C#’s analog of std::pair in C++? I found System.Web.UI.Pair class, but I’d prefer something template-based. Thank you! 14 Answers 14
Is there a good reason why there is no Pair<L,R> in Java? What would be the equivalent of this C++ construct? I would rather avoid reimplementing my own. It seems that 1.6 is providing something similar (AbstractMap.SimpleEntry<K,V>), but this looks quite convoluted. 36 s 36
In a thread on comp.lang.java.help, Hunter Gratzner gives some arguments against the presence of a Pair construct in Java. The main argument is that a class Pair doesn’t convey any semantics about the relationship between the two values (how do you know what “first” and “second” mean ?). A better practice is to write a very simple class, like the one … Read more