Skip to content

Make zips agnostic about argument order and add .get<T>() accessor

Olli Lupton requested to merge olupton_zip_sorting into master

There are two main changes here:

  • LHCb::Pr::make_zip() is modified to make make_zip( a, b ) and make_zip( b, a ) equivalent
  • The zip type (LHCb::Pr::Zip) gains a .get<T>() accessor so that the following is possible (cc: @apearce)
A a;
B b;
auto zip = LHCb::Pr::make_zip( a, b );
A const& a_ref = zip.get<A>();
B const& b_ref = zip.get<B>();
assert( &a == &a_ref );
assert( &b == &b_ref );

These changes are tested in Rec!1762 (merged).

Edited by Olli Lupton

Merge request reports