Moving implementations from .h to .cpp
Added by rti about 5 years ago
Hi.
I am just hacking a bit around in nel and ryzom client. From time to time i want to change an implementation with is made in the header file. So just checking what the change does needs ages to compile because all the cpp's including this header need to get recompiled.
I solution would be to move implementations (which do not need to be in the headers) into the cpp files.
Maybe one of those "never ending tasks" could be created for that?
rti
Replies (3)
RE: Moving implementations from .h to .cpp - Added by kervala about 5 years ago
Methods which are using templates can't be implemented elsewhere than in .h :(
Could you point some cases please ? :)
RE: Moving implementations from .h to .cpp - Added by rti about 5 years ago
Yes. Of course. And the same thing for inline functions.
The ones I found are indeed all inline. So never mind. I'll post again if I really find a candidate for moving :)
RE: Moving implementations from .h to .cpp - Added by rti about 5 years ago
Ok, found some :)
- ryzom/client/src/time_client.h
- line 77: CPacketInfos::CPacketInfos()
- line 78: CPacketInfos::CPacketInfos(uint8 num, TTime min, TTime max)
- line 163: CTickRange::extend(const CTickRange &other)
Just to name a few.
The question is: Would you accept patches for that?
While working on such a part, it would be easy to just change it. Saves lots of CPU cycles for the future :)
But I would as well understand if not, there are enough other patches to handle :)
(1-3/3)