J
Jason Doucette
I am converting a C-style unit into a C++ class. I have an
implementation function that was defined in the .cpp file (so it was
hidden from the interface that exists in the .h file). It uses a
structure that is only needed by the implementation, so it were
declared in the .cpp file, as well.
Now, when converting this into a class, the class definition exists in
the .h file, since it's required by the interface. The implementation
functions go under a "private" access specifier, so they are moved
from the .cpp file into the .h file. But, it needs access to the
above mentioned structure. It seems I must include the structure in
the .h file, making it publicly accessible!
Since no public member functions make use of the structure, I know
that no one can do anything with it, so everything is ok. But it just
seems UGLY to make something publicly accessible when it should be
hidden in the implementation.
Is there a way to achieve this?
Jason
implementation function that was defined in the .cpp file (so it was
hidden from the interface that exists in the .h file). It uses a
structure that is only needed by the implementation, so it were
declared in the .cpp file, as well.
Now, when converting this into a class, the class definition exists in
the .h file, since it's required by the interface. The implementation
functions go under a "private" access specifier, so they are moved
from the .cpp file into the .h file. But, it needs access to the
above mentioned structure. It seems I must include the structure in
the .h file, making it publicly accessible!
Since no public member functions make use of the structure, I know
that no one can do anything with it, so everything is ok. But it just
seems UGLY to make something publicly accessible when it should be
hidden in the implementation.
Is there a way to achieve this?
Jason