I think it is mostly a social convention.
However, recent GCC compilers are able to compile a (single) header foo.hh
or foo.h
into something like foo.hh.gch
or foo.h.gch
which essentially contains a persistent memory heap image of the compiler (the cc1plus
program started by g++
) after it had parsed that header.
Notice that the C++11 standard library defines header files like e.g.
without any extension.