They're different kinds of header. UI.h
is "public" - it's part of the external interface of the library, for use by its clients.
UIImpl.h
is "private," just as the UIImpl.cpp
is. As long as it's never included in a public header, it can remain invisible to clients, just as the .cpp
itself can.
There can be several reasons for splitting the impl
class definition into a header file. Perhaps some other implementation classes are passed UIImpl&
parameters. Perhaps it's easier to run doxygen on headers only. Perhaps it's just project policy.
The bottom line is, it's still Pimpl, as long as you don't publish the private header.