Why Do Headers in the Sample Projects Include Themselves? (ex: Employee.h has #include Employee.h)?


  • Several of the sample files in the C++ sample file apps seem to have  headers that include themselves. For example the XAML Data Binding sample project has a class Employee, and Employee.h incudes itself. Same with the Team class header in the same project.

    What's up with that? Is this required for some reason when you make a Bindable class?

    Friday, May 18, 2012 5:28 AM

All replies

  • The compiler probably ignores it, but it's most certainly a bug. Perhaps the code was auto-generated. Under no circumstances is it "normal" in  C++ for a header file to #include itself.


    Friday, May 18, 2012 2:24 PM