malaperle-ericsson added inline comments.
================ Comment at: clangd/ClangdUnit.cpp:276 +class DeclarationLocationsFinder : public index::IndexDataConsumer { + std::unique_ptr<std::vector<Location>> DeclarationLocations; + const SourceLocation &SearchedLocation; ---------------- malaperle-ericsson wrote: > ilya-biryukov wrote: > > Why do we need to use `unique_ptr<vector<Location>>` here and in other > > places instead of `vector<Location>`? > It was to implement "takeLocations". Calling it claims ownship of the vector. > Did you have something else in mind when you suggested to implement > takeLocations with a std::move? Disclaimer: this c++11 stuff is all new to me > so I wouldn't be surprised if I'm doing it in a terrible way. I guess I can make takeLocations return a vector&& and the other places will return a normal vector RVO will take care of not making copies? https://reviews.llvm.org/D34269 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits