Re: Final necessary for inline optimization?

2019-10-19 Thread Johan Engelen via Digitalmars-d-learn
Just a brief answer. On Saturday, 19 October 2019 at 15:58:08 UTC, IGotD- wrote: Which one is it, LDC recognizes TestClass isn't derived or is sure that the class (c) isn't derived in particular? It is the latter: the optimizer is able to prove that object c has a vtable that is known exactly

Final necessary for inline optimization?

2019-10-19 Thread IGotD- via Digitalmars-d-learn
When I'm playing around with different D compilers I get different results regarding class method inlining. According most information I have seen, you must declare a class method final for the compiler to be able inline the method otherwise it will be a virtual table call. Take this simple e