对象的某些操作,像delete,依赖于对应类型的完整性。比如一个如果类只有前向声明,没有完整定义的话,delete这个类型的指针很容易引起未定义行为:
ISO C++03/11
5.3.5/5 If the object being deleted has incomplete class type at the point of deletion and the complete class has a non-trivial destructor or a deallocation function, the behavior is undefined.
头文件包含函数实现的时候可能会出现这种情况。