Virtual value types during compile-time for static type safety, static optimizations and function overloading.

ZombineDev via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 17 16:15:29 PDT 2015


On Friday, 17 July 2015 at 21:20:41 UTC, Tamas wrote:
> Is there a solution that results the same static optimizations, 
> but has no runtime penalty, i.e. the functions just operates 
> with ints? (At least when compiled)

Did you try looking at assembly generated by GDC or LDC with full 
optimizations? For example GDC does quite better than DMD for the 
proposed SafeInt type:
https://github.com/D-Programming-Language/phobos/pull/3389#issuecomment-119005595


More information about the Digitalmars-d-learn mailing list