print_container:(name:std::string_view,cont)={std::cout<<"(name)$: \t";forcontdo(n){std::cout<<"(n)$ ";}std::cout<<'\n';}// C++ function template that calls Cpp2 `print_container` functiontemplate<typenameAdaptor>requires(std::ranges::input_range<typenameAdaptor::container_type>)voidprint(std::string_viewname,constAdaptor&adaptor){structPrinter:Adaptor// to access protected Adaptor::Container c;{voidprint(std::string_viewname)const{::print_container(name,this->c);}};static_cast<Printerconst&>(adaptor).print(name);}main:()={data:std::vector=(1,8,5,6,3,4,0,9,7,2);print_container("data",data);q1:std::priority_queue<int>=();// Max priority queuefordatado(n:int){q1.push(n);}print("q1",q1);// Min priority queue// std::greater<int> makes the max priority queue act as a min priority queueminq1:std::priority_queue<int,std::vector<int>,std::greater<int>>=(data.begin(),data.end());print("minq1",minq1);// Second way to define a min priority queueminq2:std::priority_queue=(data.begin(),data.end(),std::greater<int>());print("minq2",minq2);// Using a terse, unnamed function expression (lambda) to compare elements.minq3:std::priority_queue=(data.begin(),data.end(),:(l,r)l>r);print("minq3",minq3);// Using a named function expression (lambda) to compare elements.cmp:=:(left:int,right:int)->bool={return(left^1)<(right^1);};q5:std::priority_queue<int,std::vector<int>,decltype(cmp)>=(cmp);fordatado(n:int){q5.push(n);}print("q5",q5);}