digitalmars.D.learn - Why if(__ctfe)?
- Ilya Yaroshenko (1/1) Sep 16 2014 Why not "static if(__ctfe)" ?
- Adam D. Ruppe (5/6) Sep 16 2014 ctfe is a runtime condition. The function has the same code when
- Rene Zwanenburg (4/10) Sep 16 2014 Note that if(__ctfe) does not incur a runtime performance
- Ilya Yaroshenko (3/14) Sep 16 2014 It is a kind of magic ;)
On Tuesday, 16 September 2014 at 13:11:50 UTC, Ilya Yaroshenko wrote:Why not "static if(__ctfe)" ?ctfe is a runtime condition. The function has the same code when run at compile time, it is just being run in a different environment.
Sep 16 2014
On Tuesday, 16 September 2014 at 13:17:28 UTC, Adam D. Ruppe wrote:On Tuesday, 16 September 2014 at 13:11:50 UTC, Ilya Yaroshenko wrote:Note that if(__ctfe) does not incur a runtime performance penalty. Even in debug builds will the branch be removed.Why not "static if(__ctfe)" ?ctfe is a runtime condition. The function has the same code when run at compile time, it is just being run in a different environment.
Sep 16 2014
On Tuesday, 16 September 2014 at 13:28:17 UTC, Rene Zwanenburg wrote:On Tuesday, 16 September 2014 at 13:17:28 UTC, Adam D. Ruppe wrote:It is a kind of magic ;)On Tuesday, 16 September 2014 at 13:11:50 UTC, Ilya Yaroshenko wrote:Note that if(__ctfe) does not incur a runtime performance penalty. Even in debug builds will the branch be removed.Why not "static if(__ctfe)" ?ctfe is a runtime condition. The function has the same code when run at compile time, it is just being run in a different environment.
Sep 16 2014