You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I define a class (aka type) in CPP2 syntax (in a .h2 file), is it possible to just declare the member functions in the class definition (without body) and have the actual implementation separated in the .cpp2 file? If yes, how is it done? I'm thinking about things like the traditional PIMPL pattern for reducing compilation dependencies.
Not the .h2, the .h. As in your example where main.cpp2 does #include "widget.h".
To make the question concrete: If Widget.sum did some logging, would widget.h include the headers for the logging library (unnecessary)? Or only the widget.hpp file would?
The relevance being that if the answer is no, then this won't help for the "traditional PIMPL pattern for reducing compilation dependencies" in the OP.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
If I define a class (aka type) in CPP2 syntax (in a .h2 file), is it possible to just declare the member functions in the class definition (without body) and have the actual implementation separated in the .cpp2 file? If yes, how is it done? I'm thinking about things like the traditional PIMPL pattern for reducing compilation dependencies.
All reactions