Qt why use .h and .cpp rather than .hpp?
-
Today I came across this post https://stackoverflow.com/questions/152555/h-or-hpp-for-your-class-definitions ,
Qt is a C++ framework, and I saw all of them are*.h
and*.cpp
in source code.
So, is there any other reasons not to use*.hpp
? -
Today I came across this post https://stackoverflow.com/questions/152555/h-or-hpp-for-your-class-definitions ,
Qt is a C++ framework, and I saw all of them are*.h
and*.cpp
in source code.
So, is there any other reasons not to use*.hpp
? -
Header files are not compiled so it doesn't really matter, it's the content of the .cpp file that includes them to determine if they are considered C or C++.
It's pure flavour.
I normally use .hpp if the header contains definitions (like is the case with templates) and .h if it just contains declarations. The idea is to have some kind of a warning that if you include .hpp in multiple .cpp you are potentially compiling the same code twice. Once again it's just an opinion, you are free to call them as you prefer