Copy-Paste of source files; Compilation Guard Band's worst enemy.
![]()
In big projects, sometimes you want to write almost similar classes, which is more or less similar. For instance, assume you have a request base class, and the derived classes should implement some common virtual functions.
Usually one easy method is to copy-paste one of the existing derived class so that by making minor change, we can start the next derived class. While doing so, just remember – you are making one of the dangerous, hard to detect bug. When you try to compile your source, the second derived class you created, will show the error
Nice tips and very common error, I spend nearly 3 hours with this bug. It is really nice one.
thanks buddy!
Now a days there is no meaning in using this macro compiler guard.
#pragma once is more elegant