我有这样的事情:
use std::sync::Arc;
fn main() {
let arc = Arc::new(42);
move || { arc.clone() };
move || { arc.clone() };
}
Run Code Online (Sandbox Code Playgroud)
我正进入(状态:
error[E0382]: capture of moved value: `arc`
--> src/main.rs:6:19
|
5 | move || { arc.clone() };
| ------- value moved (into closure) here
6 | move || { arc.clone() };
| ^^^ value captured here after move
|
= note: move occurs because `arc` has type `std::sync::Arc<i32>`, which does not implement the `Copy` trait
Run Code Online (Sandbox Code Playgroud)
我理解为什么我得到这个:clone之前没有被调用arc …
在 Ubuntu 中使用 boost 库进行编译时,如何确保 GCC 使用我的 boost 路径?
Ubuntu 当前的 Boost 版本是 1.46。
我编译的是1.52版本。
我知道我可以使用“-L/path/to/new/lib”将库添加到搜索路径,但如何确保 GCC 不会链接到旧库?
问候,托默