Boost logo

Boost Users :

Subject: Re: [Boost-users] Is selective header including supposed to work?
From: Joel de Guzman (djowel_at_[hidden])
Date: 2014-04-12 16:55:35

On 4/12/14, 9:47 PM, Johannes Lorenz wrote:
> Hello,
> I like Qi, but the compile times are terrible sometimes. My example is similar to this in [1], but it needs 3x as much time to compile. I thought this problem might be omitted by including selectively what is needed. So I went into [1] and replaced
> #include <boost/spirit/include/qi.hpp>
> by
> #include <boost/spirit/include/qi_action.hpp>
> #include <boost/spirit/include/qi_grammar.hpp>
> #include <boost/spirit/include/qi_uint.hpp>
> #include <boost/spirit/include/qi_char.hpp> .
> I got far, but then, there comes up a long error message, beginning like in [2].
> My questions are:
> * is selectively including from "boost/spirit/include" supposed to work, or should this never be done?
> * if it should work, what is still left to be included in my case?

It should work, but the savings in compile time will be minimal.
If you want to reduce compile and build time, follow the example
in the compiler tutorial from calc7 up. The trick is to modularize
your grammars and put the definitions in separate cpp files (TUs).


Joel de Guzman

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at