New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split into multiple headers for development and merge for distribution #31
Comments
@moonshadow565, thanks for the suggestion. Yes, I understand it has a number of benefits. But I still prefer keeping it in one file which doesn't depend on any other process such as merging or building process. My other 'cpp-???' libraries (cpp-peglib, cpp-linenoise, cpp-mmaplib...) also follow the same principle.
This is actually a nice code improvement. I'll implement it when I have time. Thanks! |
Tbh the only upside i can see with single file vs single folder is that its slightly easier to download. EDIT: |
I understand it's painful. 😢 (I guess I like the @antirez's style which contains everything in a single .c file like linenoise.c and kiko.c. Of course he doesn't use the style for large scale projects such as redis.)
Glad to hear that! @underscorediscovery also mentioned he could implement it at this comment. Since all my projects using cpp-httlib don't actually need websocket right now, it would be nice if we could enable the websocket feature with the define symbol
A number of libraries in C++ Boost library uses
I totally agree it should be done. I have just made the issue #32.
True. I renamed it to be
Great find! Could you make a new issue specifying the places that cause the unnecessary copies?
Thanks! I renamed it to
No problem at all. 😄 It's actually good for me to hear from others, so that I could look into the library from different perspective. Even though I may not take all suggestions from people, I always appreciate such thoughts. Of course since this is my personal project, I can spend time only when I am available. Thanks for your patience! |
Ty for your time. I understand purpose of I will be trying to add websockets there when i get time. |
It would be really helpfull to split the library into multiple
.hpp
files for development and then merge them into single.hpp
/.h
for distribution :)Examples:
https://github.com/ThePhD/sol2/blob/develop/single.py
https://github.com/oftc/jsoncpp/blob/master/amalgamate.py
https://github.com/connormanning/arbiter/blob/master/amalgamate.py
This would not only allow for easier development but also for possible PRs/contributions or simple modifications/extensions that others might need to make.
It would also improve code reuse and abstraction mechanisms.
For example
sprintf_socket
could be made as a methodwritefmt
ofStream
and not implementation detail.The text was updated successfully, but these errors were encountered: