Some classes, like exceptions or templates, only need the header file (.h), often there is no .cpp related to them.
I have seen some projects were (for some classes) there aren't any .cpp files associated to the headers files, perhaps because the implementation is so short that it is done directly in the .h, or maybe for other reasons, such as template classes, where it is mandatory to include the implementation in the header.
What is your opinion, if a class is too short, sould I avoid creating a .cpp file and writing the code directly on the header file ? If the code is written in the header file, should I include an empty .cpp so the files in the project remains consistent ?