Moving the kernel to modern C
Moving the kernel to modern C
Posted Feb 25, 2022 22:12 UTC (Fri) by ncm (guest, #165)In reply to: Moving the kernel to modern C by pbonzini
Parent article: Moving the kernel to modern C
Of course in C++ and Rust you have function literals. In C++,
  auto f = [](auto a, auto b) { return a + b; };
  assert(f(3, 4) == 7);
  assert(f(3.25, 3.75) == 7.0);
  assert(f("3"s, "4"s) == "34");
Rust lambdas might be less versatile.
        
      Posted Feb 26, 2022 0:18 UTC (Sat)
                               by camhusmj38 (subscriber, #99234)
                              [Link] 
       
     
    
      
Moving the kernel to modern C
      
      
      
No, Rust Lambdas generally work the same as C++ lambdas - subject to the usual Rust rules about lifetime.
      
          
            
          
        
     
           