unique_ptr makes the ownership clearer than a raw pointer container.
Details
Details
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
Given the context (class an file name itself) and documentation around the function, I don't think in this particular case it improves readability or maintainability, the lifetime of the HeaderMap is (IMHO) fairly obvious from the const qualifier and from the documentation of the function itself. I would say leave it as is.
Comment Actions
I'd vote in favor of the change - since it makes the ownership obvious at-a-glance (documentation or not) & helps catch any mistakes that can be easily introduced when handling object ownership.