Moving the kernel to modern C
Moving the kernel to modern C
Posted Feb 25, 2022 20:55 UTC (Fri) by pbonzini (subscriber, #60935)In reply to: Moving the kernel to modern C by abatters
Parent article: Moving the kernel to modern C
Posted Feb 25, 2022 22:12 UTC (Fri)
by ncm (guest, #165)
[Link] (1 responses)
Posted Feb 26, 2022 0:18 UTC (Sat)
by camhusmj38 (subscriber, #99234)
[Link]
Of course in C++ and Rust you have function literals. In C++,
Moving the kernel to modern 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.
Moving the kernel to modern C