Should helper functions which are only used within the implementation file be excluded from header file declarations?
By helper function I mean a convenience function that is closely associated with a class, but doesn’t represent an operation on the class, does not need access to member variables, and as such is not a method.
On one hand, including them in the header file makes the header file a comprehensive reference for the corresponding c++ implementation. On the other hand, it introduces one more piece of code to maintain for consistency. More importantly, including helper functions encourages minor violations of a layer of abstraction, in the sense that the function isn’t meant to be run in other contexts, although not in a severe way since there’s not a risk of corrupting class state so long as the helper function itself is not breaking encapsulation of classes it works with.
That’s not the purpose of a header file. A header file is supposed to be a reference for the interface, not the implementation. Some implementation details will sometimes leak through, but this should be avoided wherever possible.
So to answer your headline question: yes.