
On Mon, Sep 1, 2014 at 11:26 AM, Matt Calabrese
On Mon, Sep 1, 2014 at 8:00 AM, Robert 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
...
Even if your condition is known through a compile-time constant bool, If you don't add a level of indirection to prevent both from being instantiated, either manually or by way of a higher-level facility like a static if, your compile time for that translation unit can possibly double, or worse.
Yes, the point of static if wouldn't necessarily be performance even if compile-time performance could be improved by it, as Matt already pointed out (similar points are made in the various static if N-papers). In fact, in my original example the static if is used for correctness and not performance (so to check the assertion when T provides the appropriate operations for the check to actually compile). --Lorenzo