Translate C++ code and lifetime issue


#1

C++ code http://cpp.sh/3sbc

how to translate?

http://is.gd/q0D9xk


#2

Please post what you tried so far, so we can try to help you better.


#3

updated http://is.gd/q0D9xk


#4

Also, this kind of quesiton is better suited for users.rust-lang.org, this forum is for discussing the development of Rust itself. Thanks!


#5