Translate C++ code and lifetime issue

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

how to translate?

http://is.gd/q0D9xk

1 Like

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

updated http://is.gd/q0D9xk

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