News for hackers. Stuff that matters.
Re:Rust lifetimes: Getting away with things that would be re... by zyngaro on Saturday September 20, 2014 @03:51PM (#8345419)
If you want to force the programmer to keep string around, remove the 'const' from the function signature. The compiler will rigtly complain when you call the function with a r-value as argument and will only accept l-values. l-values and r-values are the C++ way for dealing with this kind of situation. C++ has also some means to prevent from doing weird stuff.

There are no comments on this comment yet.