<div dir="ltr">2016-03-01 9:13 GMT-03:00 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span>:<br><div class="gmail_extra"><div class="gmail_quote"><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 01.03.2016 04:08 schrieb "Mazola Winstrol" <<a href="mailto:mazofeifer@gmail.com" target="_blank">mazofeifer@gmail.com</a>>:<br>
> Is there any way to overcome this? Is there any way to tell the compiler to ignore some operators depending on the specialization type?</p>
</span><p>No, there is not. Better not use operators other than the assignment ones or provide different Nullable types for different purposes (that maybe can be assigned to each other).</p></blockquote><div><br></div><div>The problem is type the same structures for the various nullable types. Perhaps, a "ugly" solution would be:<br><br></div><div><br>===== code =========<br><br></div><div><span style="color:rgb(0,0,0)">{$mode delphi} <br><br></span></div><div><span style="color:rgb(0,0,0)">{$DEFINE typename:=TSimpleNullableType<T>}<br>typename = record<br></span></div><div><span style="color:rgb(0,0,0)">strict private<br>   {$INCLUDE commonprivatedefinition.inc}<br>public<br>   {$INCLUDE commonprivatedefinition.inc}<br>end;<br><br></span><div><span style="color:rgb(0,0,0)">{$DEFINE typename:=TArithmeticNullableType<T>}<br>typename = record<br></span></div><div><span style="color:rgb(0,0,0)">strict private<br>   {$INCLUDE commonprivatedefinition.inc}<br>public<br>   {$INCLUDE commonprivatedefinition.inc}<br>   class operator Negative(A: TArithmeticNullableType<T>): T;<br></span></div><span style="color:rgb(0,0,0)">end;</span><br><br></div><div>==== code ======<br><br></div><div>Regards<br></div><div> </div><div> </div><div><br><br></div></div></div></div>