3 ms·
There are a few reasons you would do this in CPP, though I'm not sure whether they apply to this case. You might put function definitions in headers to (1) avo
by munchbunny 10y ago
There are a few reasons you would do this in CPP, though I'm not sure whether they apply to this case.
You might put function definitions in headers to (1) avoid linking a library (2) explicitly declare a function as inline, maybe (3) it's simple enough that you don't lose readability by inlining it.
The one about putting large classes entirely in CPP files: I wouldn't do it this way for readability reasons, but putting it in the CPP file directly does restrict anybody else from using what is supposed to be a one-off helper class. I think that's the intent here.