Use of deleted function std::unique_ptr

Hello all,

I have the following lines of code. To run it, I need to change the rule of the function “EnterTokenStream” from private to a public function in “/usr/local/include/clang/Lex/Preprocessor.h”. In this case this code will working with raw pointer “*Toks”.

Probably you can grep -r "EnterTokenStream" lib/* to see how pass unique_ptr to

EnterTokenStream. Seem you need to use std::move.

HTH,
chenwj

Hello Chenwj,

Thank you for your reply. I did the following and it did work:

replace:

You can still use std::copy, but you’d need to pass Toks.get() as the last arg, instead of just ‘Toks’.