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
Describe the bug
As the implementation and declaration stays in one file, i can not include this file in different source files
if these files would be linked together. Because multiple definition exist in object files.
You may separate the implementation into .cc file ?
The text was updated successfully, but these errors were encountered:
I see, you use inline for keep this header work in multiple files. But i find some methods are still not inline,which makes the problem.
I can successfully compile by fix the methods by add "inline" keyword, but i think it is not a good solution as the code size grows a lot in my case.
I think a separate the implementation into .cc file is still a good idea.
Indeed some inlines where missing. I missed adding a test to ensure that including it into multiple implementation files works. I'll push a fix for that.
I understand, that there are arguments for a separated approach, but this is explicitly designed as a header-only/single-file solution, so currently there are no plans for separation into a .h/.cpp pair of files or even more files.
I once had an early version that supported separation by including the header with specific defines for implementation or forwarding header, but the effect was not as relevant as I had hoped, the code got quite a bit uglier to work with, and with link-time-optimization (-flto on gcc) most redundancies are dropped from the binary.
Still if multiple shared libraries are including this header, it might make more of a difference, but the results of that tests pushed the feature down the list.
Describe the bug
As the implementation and declaration stays in one file, i can not include this file in different source files
if these files would be linked together. Because multiple definition exist in object files.
You may separate the implementation into .cc file ?
The text was updated successfully, but these errors were encountered: