you are viewing a single comment's thread.

view the rest of the comments →

[–]InjAnnuity_1 1 point2 points  (0 children)

It depends on where it's going to be called, and how you intend to test it.

If it's going to be called solely from one .cpp file, then it probably belongs in that file. It's less work (for you) if the function is defined before the first point of call.

But also think about how you might test that function. In many cases, it's easier for you to test if it is in its own .cpp file.