I use boost::intrusive_ptr
in my project and have such code:
void foo(boost::intrusive_ptr<MyObject> obj) {
// do something with obj
}
And I have clang-tidy diagnostic:
Clang-Tidy: The parameter 'obj' is copied for each invocation but only used as a const reference; consider making it a const reference
But boost::intrusive_ptr
copying on function invocation is intended usage of it, because it's wrapping a pointer and usually we don't want to add one more level of indirection. There are no such diagnostic for std::shared_ptr
which have similar usage.
How to add boost::intrusive_ptr
to the list of clang-tidy exceptions for this diagnostic rule to avoid false warnings?