P:@structtype={first:int=0;second:char='\0';operator<<:(inoutos:std::ostream,p:P)->forwardstd::ostream={os<<'{'<<p.first<<",'"<<p.second<<"'}";returnos;}}print_array:(name:std::string_view,arr)={std::cout<<"(name)$: ";(copyn:=arr.ssize())forarrdo(e){std::cout<<e;n--;ifn>0{std::cout<<", ";}else{std::cout<<"\n";}}}main:()={a:std::array=(1,2,3,4,5);print_array("a",a);// Negate first three numbers:std::ranges::for_each_n(a.begin(),3,:(inoutn)=n*=-1);print_array("a",a);s:std::array=(:P=(1,'a'),:P=(2,'b'),:P=(3,'c'),:P=(4,'d'));print_array("s",s);// Negate data members 'P::first' using projection:std::ranges::for_each_n(s.begin(),2,:(inoutx)=x*=-1,P::first&);print_array("s",s);// Capitalize data members 'P::second' using projection:std::ranges::for_each_n(s.begin(),3,:(inoutc)=c-='a'-'A',P::second&);print_array("s",s);}