I have an assignment where I need to put the implementation in the header file instead of the .cpp file. I know it's not normal to do so, so I would like to know if there are any examples on how to do so? How does it look different and is there anything I have to watch out for?
Basically, to put code in headers you must have either an inline function, or a template-based function (or class function member).
For variables, the header must contain an "extern" keyword before, and the source must contain an "extern"-less version of the variable, initialized on place.