Am Fri, 09 Sep 2016 10:32:59 +0000 schrieb Stefan Koch <[email protected]>:
> On Friday, 9 September 2016 at 09:31:37 UTC, Marco Leise wrote: > > > > Don't worry about this special case too much. At least GCC can > > turn padLength from a runtime argument into a compile-time > > argument itself, so the need for templates to do a poor man's > > const-folding is reduced. So in this case the advise is not to > > use a template. > > This is not what this is about. > This is about cases where you cannot avoid templates because you > do type-based operations. > > The code above was just an example to illustrate the problem. Fair enough. I hope there is a less complex solution that all compilers could benefit from. -- Marco
