<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 21 August 2015 at 13:03, Mike via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Friday, 21 August 2015 at 08:11:37 UTC, Kagamin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Friday, 21 August 2015 at 06:00:44 UTC, Mike wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Disabling TypeInfo forces one to compromise on slicing, postblit<br>
</blockquote>
<br>
Why slicing and postblit would need typeinfo?<br>
</blockquote>
<br></div></div>
See below for the source code.  Some obvious, some not.<br>
<br>
* dynamic cast - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-83bcb64558f947e39f87d7435709dfe7R364" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-83bcb64558f947e39f87d7435709dfe7R364</a><br>
* array literal - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-bed7d2226948b1e098749985d7a60633R2353" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-bed7d2226948b1e098749985d7a60633R2353</a><br>
* postblit - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-1f51c84492753de4c1863d02e24318bbR918" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-1f51c84492753de4c1863d02e24318bbR918</a><br>
* destructor - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-1f51c84492753de4c1863d02e24318bbR1039" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-1f51c84492753de4c1863d02e24318bbR1039</a>, <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-867588d7078efd0364c256152fb5a2e7R2053" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-867588d7078efd0364c256152fb5a2e7R2053</a><br>
* new - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-5960d486a42197785b9eee4ba95c6b95R5091" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-5960d486a42197785b9eee4ba95c6b95R5091</a><br>
* AAs - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-5960d486a42197785b9eee4ba95c6b95R10710" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-5960d486a42197785b9eee4ba95c6b95R10710</a><br>
* slicing - <a href="https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-5960d486a42197785b9eee4ba95c6b95R11857" rel="noreferrer" target="_blank">https://github.com/D-Programming-GDC/GDC/pull/100/files?diff=unified#diff-5960d486a42197785b9eee4ba95c6b95R11857</a><br>
<br>
etc...<br>
<br>
Disabling TypeInfo requires quite a compromise on D's features.  I want TypeInfo, I just don't want dead code.<br>
<br>
</blockquote></div><br></div><div class="gmail_extra">Where removing RTTI disables D feature's in a compromising way, I'd start by questioning the why.<br><br></div><div class="gmail_extra">Eg:  Why does array literals need RTTI?  Looking at _d_arrayliteralTX implementation, it only does the following with the given TypeInfo provided:<br><br></div><div class="gmail_extra">- Get the array element size (this is known at compile time)<br></div><div class="gmail_extra">- Get the array element type flags (calculated during the codegen stage, but otherwise known at compile time)<br></div><div class="gmail_extra">- Test if the TypeInfo is derived from TypeInfo_Shared (can be done at - you guessed it - compile time by peeking through the baseClass linked list for a given TypeInfo type we are passing).<br><br></div><div class="gmail_extra">So we have this function that accepts a TypeInfo, but doesn't really *need* to at all.<br><br>void* _d_arrayliteralTX(size_t length, size_t sizeelem, uint flags, bool isshared);<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Just putting it out there....<br><br></div><div class="gmail_extra">Iain.<br></div></div>