Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++ranges librarySingle-choice MCQ

What does ps look like after this call, and what feature is being used?

#include <ranges> #include <vector> #include <iostream> struct P { int key; }; int main() { std::vector<P> ps{{3},{1},{2}}; std::ranges::sort(ps, {}, &P::key); for (auto& p : ps) std::cout << p.key << " "; }