3 ms·
I'm standing by for the announcement that some caffeine-addled Boost metaprogramming madman has implemented the Rust borrow checker as a C++ template, or at lea
by smitty1e 4y ago
I'm standing by for the announcement that some caffeine-addled Boost metaprogramming madman has implemented the Rust borrow checker as a C++ template, or at least thinks that he may have, when the compilation completes sometime in the 2030s.
- gpderetta 4y agoIt is not like I didn't try...
- steveklabnik 4y agohttps://docs.google.com/document/d/e/2PACX-1vSt2VB1zQAJ6JDMaIA9PlmEgBxz2K5Tx6w2JqJNeYCy0gU4aoubdTxlENSKNSrQ2TXqPWcuwtXe6PlO/pub https://docs.google.com/document/d/e/2PACX-1vSt2VB1zQAJ6JDMa...
- smitty1e 4y agoIt's not clear how much boost.org magic they used. Failing that, a GCC extension could be needful. From the ref: --- Conclusion We attempted to represent ownership and borrowing through the C++ type system, however the language does not lend itself to this. Thus memory safety in C++ would need to be achieved through runtime checks. Example code #include <type_traits> #include <utility> #include <assert.h> #include <stddef.h>
- wyldfire 4y agoThere is a branch of clang with support for "-Wlifetime" which might be a simpler alternative.
- sudosysgen 4y agoWhy use template metaprogramming? You can use compiler extensions for that since the code will be valid either way
- smitty1e 4y agoC++ has the Maximum Pain Rule. Templates it must be.