Skip to content
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

Don't #include <fstream> or <iostream> in headers. #291

Open
6 tasks
yakra opened this issue Oct 29, 2024 · 0 comments
Open
6 tasks

Don't #include <fstream> or <iostream> in headers. #291

yakra opened this issue Oct 29, 2024 · 0 comments

Comments

@yakra
Copy link
Owner

yakra commented Oct 29, 2024

Reduce compile time:
Don't #include <fstream> or <iostream> in headers.

#include <string> when needed. This can avoid extraneous:

Disassembly of section .text.startup:

0000000000000000 <_GLOBAL__sub_I_datacheck.cpp>:
   0:   50                      push   rax
   1:   bf 00 00 00 00          mov    edi,0x0
   6:   e8 00 00 00 00          call   b <_GLOBAL__sub_I_datacheck.cpp+0xb>
   b:   bf 00 00 00 00          mov    edi,0x0
  10:   be 00 00 00 00          mov    esi,0x0
  15:   ba 00 00 00 00          mov    edx,0x0
  1a:   58                      pop    rax
  1b:   e9 00 00 00 00          jmp    20 <_GLOBAL__sub_I_datacheck.cpp+0x20>

https://stackoverflow.com/questions/31691280/what-does-global-sub-i-mean-in-nm-output#66254512

For forward declarations of fstreams, #include <iosfwd>.
Reddit links here, which links here.

Files:

  • WaypointQuadtree.h
  • Waypoint.h
  • Args.h
  • HGEdge.h
  • PlaceRadius.h
  • ErrorList.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant