Conversation
Don't put nanosvg functions into the global namespace in a header file, it'll polute the global namespace for all users of that header.
If fclose() fails, something is wrong, don't just carry on as if nothing happened but report the error by throwing an exception.
The header files make no direct use of these includes, so they should not be there. If implementation files need the headers they should include them directly.
|
Some feedback on 2 of your commits. I will cherry-pick the others and close this PR in a moment. Avoid global names in header filesThe global Note that the Simplify some code by using std::any_of/std::all_ofI'm not used to using these functions, so I personally find the code slightly harder to read. That's just lack of experience with them though, I do believe it is good to use them and I should probably learn to use them more myself. However, (and maybe it's just because I'm not used to them), I feel like it's wrong to use these functions when the body has side effects. I know that these functions will still execute the body sequentially, but I feel like any_of and all_of should only be used if the code COULD be parallelized in the future. So I don't really like the I have less of a problem with I'm not merging the commit now because of the |
|
Thanks a lot for your feedback. I''ll include the all_of change in a future PR and I'll keep the other feedback in mind. |
Hi Texus
Here's another small batch of small cleanups for you to consider :-)
Kind regards
Jesper Juhl