|
You are here |
sdowney.org | ||
| | | | |
donsbot.com
|
|
| | | | | I've been learning Rust for the past twenty days or so, working through the Blandy & Orendorff book, coding up things as I go. Once I got into playing with Rust traits and closures and associated types, the similarities to programming in Haskell with typeclasses, data structures, closure passing and associated types was pretty obvious.... | |
| | | | |
quuxplusone.github.io
|
|
| | | | | Consider the following example of an "STL-style algorithm," taken from a lab exercise in one of my training courses: template<class It> bool is_palindrome(It first, It last) { while (first != last) { -last; if (first == last) break; if (*first != *last) { return false; } ++first; } return true; } A palindrome is equal to itself when read forwards or backwards, so, I said blithely, we could rewrite it like this: template<class It> bool is_palindrome(It first, It last) { return std::equal( first, last, std::reverse_iterator(last), std::reverse_iterator(first) ); } But look out - this code has a bug that causes undefined behavior! Do you see it? | |
| | | | |
www.kuniga.me
|
|
| | | | | NP-Incompleteness: | |
| | | | |
os.phil-opp.com
|
|
| | | In this post, we explore cooperative multitasking and the async/await feature of Rust. We take a detailed look at how async/await works in Rust, inclu | ||