Introduce a new trait Init for initializers. Initializers are essentiallyfunctions that write a value to the place provided to it. Along with the trait,we also introduce:| HackMD
pub struct A { a: i64, b: i64, c: i64, d: i64, e: i64, } impl A { pub fn new() -> A { A { a: 42, b: 69, c: 4269, d: 6942, e: 696942, } } }| godbolt.org
This post is also available on Sy Brand’s blog C++17 merged in a paper called Guaranteed copy elision through simplified value categories. The changes mandate that no copies or moves take place in some situations where they were previously allowed, e.g.: struct non_moveable { non_moveable() = default; non_moveable(non_moveable&&) = delete; }; non_moveable make() { return […]| C++ Team Blog
Syntactic Musings on View Types| blog.yoshuawuyts.com
in-place construction seems surprisingly simple?| blog.yoshuawuyts.com
placing functions| blog.yoshuawuyts.com
The lifetime of temporaries in Rust is a complicated but often ignored topic. In simple cases, Rust keeps temporaries around for exactly long enough, such that we don’t have to think about them. However, there are plenty of cases were we might not get exactly what we want, right away. In this post, we (re)discover the rules for the lifetime of temporaries, go over a few use cases for temporary lifetime extension, and explore a new language idea, super let, to give us more control.| Mara's Blog
Ergonomic Self-Referential Types for Rust| blog.yoshuawuyts.com