If I have a POD (Plain Old Data) C++ class Foo, the common view is that one does not need to define a copy constructor nor an assignment operator for it, because C++ will do it automatically.
My question is, if Foo.h is included in multiple .cpp files and the Foo assignment operator is invoked in each of these .cpp files, will VS2008 generate multiple copies of the default assignment operator in the resulting .obj files? (I work on a very large project and I’m trying to reduce the size of binary files generated during the build.)
The operator will be emitted into all of those .obj files (just like any other inline function). However, all but one of those functions will be discarded by the linker (if you have optimizations enabled).