|
You are here |
sdowney.org | ||
| | | | |
verdagon.dev
|
|
| | | | | [AI summary] The author explains how concept functions in Vale 0.2 Beta allow passing functions as generic parameters to specify constraints on types, comparing this approach to C++ requires clauses, Rust traits, and historical C function pointers. | |
| | | | |
poignardazur.github.io
|
|
| | | | | This is an informal proposal for improving the Rust programming language. I'll assume familiarity with the language. | |
| | | | |
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? | |
| | | | |
intezer.com
|
|
| | | Learn how AI empowers security teams to boost threat detection, automate alerts, and strengthen cybersecurity efforts. | ||