C++ class definition split into two headers? -
C++ class definition split into two headers? -
is possible in c++ split definition of class members in 2 headers? appropriate way code it?
for instance:
a1.h
class { public: int var; void foo1(int b); }
a1.cpp
#include "a1.h" void a::foo1(int b) { cout << b; }
a2.h
[extend] class { public: void foo2(double c); }
a2.cpp
#include "a2.h" void a::foo2(double c) { cout << c; }
you can't extend class
way, can utilize pimpl
pattern:
class { public: void foo1(int b); private: aimpl* pimpl; }
and have aimpl.h
, aimpl.cpp
hides private details.
c++ class header-files partial-classes
Comments
Post a Comment