Skip to content

Instantly share code, notes, and snippets.

@picanumber
Created January 11, 2017 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save picanumber/e6e560cc98f259af4fa51e29d3c3f7d3 to your computer and use it in GitHub Desktop.
Save picanumber/e6e560cc98f259af4fa51e29d3c3f7d3 to your computer and use it in GitHub Desktop.
Traversing the sorted view with structured bindings
sv.multi_sort<6, 4, 5>([](auto&& a, auto&& b) { return a > b; });
auto [sName1, sName2, sSport, sGoldM, sSilverM, sBronzeM, sTotalM] = sv;
for (size_t i = 0; i < sv.size<6>(); i++)
{
std::cout << sTotalM[i] << " " << sGoldM[i] << " " << sSilverM[i] << " "
<< sName1[i] << " " << sName2[i] << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment