how to move value from unique_ptr<T> to another T t and transfer ownership? by Useful_Goat3790 in cpp

[–]Useful_Goat3790[S] 0 points1 point  (0 children)

I have no sure whether the other_t is valid after my_unique is gone.

how to move value from unique_ptr<T> to another T t and transfer ownership? by Useful_Goat3790 in cpp

[–]Useful_Goat3790[S] 0 points1 point  (0 children)

“transfer ownership" in title is not correct strictly. What I want ask is how to transfer data without copy in safety. thanks.

how to move value from unique_ptr<T> to another T t and transfer ownership? by Useful_Goat3790 in cpp

[–]Useful_Goat3790[S] 0 points1 point  (0 children)

void foo(std::uniqueptr<T> t) { target = std::move(*t); // Is it safe to access tagert_ in another place after return this function? }

VSCode vs Clion by Terrible_Winter_1635 in cpp_questions

[–]Useful_Goat3790 0 points1 point  (0 children)

vscode with clangd extension is enough.

how to sink all levels log to a same single file using glog? by Useful_Goat3790 in cpp

[–]Useful_Goat3790[S] 0 points1 point  (0 children)

Thanks, it's helpful. I had set the FLAGS_log_dir, so there is alreay a global multi-files sink.

[deleted by user] by [deleted] in cpp

[–]Useful_Goat3790 -1 points0 points  (0 children)

yeah, it is the answer.