<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2015-10-10 18:40 GMT+02:00 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><p>Am 10.10.2015 18:19 schrieb "Maciej Izak" <<a href="mailto:hnb.code@gmail.com" target="_blank">hnb.code@gmail.com</a>>:<br>
> class operator TSmartPtr<T>.Copy(constref aSource: TSmartPtr<T>; var aDest: TSmartPtr<T>);<br>
> begin<br>
> if aDest.RefCount <> nil then<br>
> Finalize(aDest);<br>
> if aSource.RefCount <> nil then<br>
> InterLockedIncrement(aSource.RefCount^);<br>
> aDest.RefCount := aSource.RefCount;<br>
> aDest.Instance := aSource.Instance;<br>
> end;</p>
</span><p>Shouldn't it be SmartFinalize here as well instead of Finalize?</p></blockquote><div>Yes, it should be SmartFinalize. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
</span><p>While I see and understand your reasoning behind it I don't really like it... There needs to be some better way for this... hmm... :/</p></blockquote><div>I am only sure about MANAGEMENTOPERATORS.<br><br></div><div>instead of "default" field we can introduce:<br><br></div><div>operator Dot: T;<br></div><div>operator Dereference: T;<br></div><div>operator Addr: T;<br></div><div>operator DoubleAddr: T;<br></div><div>operator DefaultImplicit: T;<br></div><div>operator TypeInfo: PTypeInfo;<br></div><div><br></div><div>but this solution is much slower. btw. we can introduce also this operators for better control of "default" field. (all of above operator have higher priority than "default" field and "default" field has bigger priority than class operator).</div><div> <br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>