Off late I have had too use some template libraries like Boost and Thrust (for CUDA) in some of my coding work.
For using a certain feature of the Boost library, one has to include the appropriate header.e.g. for boost::lexical_cast I have to use boost/lexical_cast.hpp. It is tiring to keep including the appropriate header for every new feature of Boost / Thrust which I use for my projects.
Is there any “shortcut” to tell the pre-processor to include all the header files stored under the boost library, so that I need not bother about which header file to include?
I am using GCC under Ubuntu.
You could simply make a mother-of-all header file like so:
Now you can add that and use precompiled headers (you may need an overnight compilation to make the PCH). You should also pass
-Wl,-as-neededto the linker to avoid including unneeded libraries.As @sbi says, this isn’t advisable in the least, but since you asked… sometimes the best remedy against finding something “tiresome” is to see how much worse it could be!