Menu

Finer-grained inclusion

2022-12-27
2023-04-28
  • Emilio Mª López Riñón

    Hi,

    I've been using half for my personal project and overall I can say I'm quite happy with it. The only issue I have is that my compile times are affected quite a bit by some of the includes the library pulls in. I've already set HALF_ENABLE_CPP11_HASH=0 and HALF_ENABLE_CPP11_TYPE_TRAITS=0 as the existing options, but a few includes still remain.

    The heaviest hitters are "algorithm", which I comment out and still compiles, "iostream", which I comment out as well as the stream operators, and "utility", which I comment out and still compiles after these changes, but limits, cmath, etc. they're all affecting it too. I have a local version that puts them behind defines which you may be interested in, but other than that my request is whether half can be more granular in the inclusion of external dependencies. There's a lot of stuff in there I'm happy to live without.

    Thanks!

     

    Last edit: Emilio Mª López Riñón 2022-12-28
    • Christian Rau

      Christian Rau - 2023-04-28

      Hello,

      I don't really want to hide all the necessary headers behind configuration macros, though. There already are quite a few macros and some things can just be assumed as given. I might consider making the streaming operators optional (as "iostream" can indeed be quite a monster) and I will also try to look into what "algorithm" is even used for. But things like "utility" and "cmath" are just necessary. I'm not going to implement my own swap function in in 2023. ;-)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.