automatic way to detect objects passed by value to functions in c++
<p>I and my co-coder often forget to pass (large) objects by reference and instead pass by value. This might be hurting performance. Is it possible to configure the compiler to warn me in such cases? Is it possible to detect it automatically in a bunch of c++ source files ... maybe a regex that someone has already written?</p>

<p>UPDATE:
Thanks guys for your helpful answers. One problem with all answers is that they only work for classes I write ... not for existing classes .. like <code>std::vector</code> . I can subclass them, but it would be too tedious</p>
