I am working on a library which had several headers that are meant to only be used by the library itself. I also have a few classes and functions in headers that I do not want the client to use. For instance, I have a header that contains debugging functions, but they should not be used outside of the library as it could cause problems.Should this code be hidden from the client? If so, how?
Should non-interface code be hidden from the client?
c++;libraries;headers
A common way to handle this is public and private headers.Given that some things must appear in a header file, either for physical implementation reasons, or for performance/inlining reasons, you need to split somehow.Have your public header include the private header; and add comment(s) nearby that this is an implementatinn detail and subject to change.Of course, you still need to ship the headers, and they will be visible to your end user, but they would use those internals at their own risk.