Sorry if this is a dumb question, but it seems like std::pair is fairly widely used in our code base. Can you explain the circumstances in which you think we should be using mozilla::Pair instead?
Ekr On Thu, Mar 12, 2015 at 5:53 PM, Seth Fowler <s...@mozilla.com> wrote: > I thought I’d let everyone know that bug 1142366 and bug 1142376 have > added some handy new features to mozilla::Pair. In particular: > > - Pair objects are now movable. (It’s now a requirement that the > underlying types be movable too. Every existing use satisfied this > requirement.) > > - Pair objects are now copyable if the underlying types are copyable. > > - We now have an equivalent of std::make_pair, mozilla::MakePair. This > lets you construct a Pair object with type inference. So this code: > > > Pair<Foo, Bar> GetPair() { > > return Pair<Foo, Bar>(Foo(), Bar()); > > } > > Becomes: > > > Pair<Foo, Bar> GetPair() { > > return MakePair(Foo(), Bar()); > > } > > Nice! This can really make a big difference for long type names or types > which have their own template parameters. > > These changes should make Pair a little more practical to use. Enjoy! > > - Seth > _______________________________________________ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform > _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform