|
Boost : |
Subject: Re: [boost] [static_if] Is there interest in a `static if` emulation library?
From: Robert Ramey (ramey_at_[hidden])
Date: 2014-09-01 18:06:59
Matt Calabrese wrote
> On Mon, Sep 1, 2014 at 8:00 AM, Robert Ramey <
> ramey@
> > wrote:
>
>> The compile-times argument doesn't impress me much though. Using
>> a much more complex syntax or new library to shave a tiny bit of
>
> time of the compilation isn't a good trade off for me.
>>
>
> The problem is that it can be far from tiny in practice. Compile-times are
> often proportional to the amount of template instantiations you make, and
> so when one branch makes a lot of them (I.E. one line of code instantiates
> a ton of templates indirectly), it's horrible. Have you ever made a Spirit
> grammar that takes minutes to compile?
actually I have. But that was a very unusual case. In practice I just
write the simple version and worry about when I find that it's a
performance bottleneck. Actually, that's what I do with all my code.
Turns out that only very infrequently (never?) do I have to go back and
complicate things to address compilation times.
FWIW - I'm extremely skeptical of performance claims based on
speculation. It wouldn't surprise me of compilers are already
skipping compilation of dead branches for which it can be easily
determined that there are no compile-time side-effects. In fact
since I generally have very little problem with compile times these
days - in spite of writing a lot of template code - I'll bet that
compiler writers already do this. Not that it matters because
it's just not a problem except in contrived pathological cases.
Robert Ramey
-- View this message in context: http://boost.2283326.n4.nabble.com/static-if-Is-there-interest-in-a-static-if-emulation-library-tp4667118p4667155.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk