Fatal Error C1060 compiler is out of heap space

There is possibility of getting the above error when you compile a C++ application that is making heavy use of templates with covariant return types

I had a customer who was getting the above error (As a support engineerĀ I thought I can write a post that might be helpful for users who come across the above error)

We tried suggestions as specified in msdn2.microsoft.com/en-us/library/yz7kx3y2.aspx

We also tried clearing TEMP Folder.

After checking in our internal database I came to know that it is by design.

The following are the workarounds suggested

1) using shorter names or 2) less complicated class templates or 3) remove the usage of covariant return types.

In this case we got rid of the above error by removing covariant return types