While working on some new bindings, I've discovered that if opAssign
in a struct template "BindingTempl(T)
" has the return type "BindingTempl!T
then it adds about 4 seconds to the compile time per instantiation of BindingTempl
. The added compile time is much lower if a function other than opAssign
returns BindingTempl!T
. Is opAssign a particularly bad operator to overload in templates or something?
Thread overview | |||||
---|---|---|---|---|---|
|
July 09, 2023 Weird template instantiation speed? | ||||
---|---|---|---|---|
| ||||
July 09, 2023 Re: Weird template instantiation speed? | ||||
---|---|---|---|---|
| ||||
Posted in reply to IchorDev | On 7/9/23 7:54 AM, IchorDev wrote: >While working on some new bindings, I've discovered that if This is probably a bug somewhere, 4 seconds is too much. A reduced test case would be helpful. But I wanted to note, inside a struct template, the template name (by itself) is equivalent to the current instantiation. So just returning See if that helps. -Steve |
July 09, 2023 Re: Weird template instantiation speed? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Sunday, 9 July 2023 at 14:49:39 UTC, Steven Schveighoffer wrote: >This is probably a bug somewhere, 4 seconds is too much. A reduced test case would be helpful. But I wanted to note, inside a struct template, the template name (by itself) is equivalent to the current instantiation. So just returning See if that helps. -Steve Thank you for letting me know about being able to use If anyone wants to try to reproduce this issue:
|