Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am
So., 10. Nov. 2019, 02:11:

>
>
> > On Nov 7, 2019, at 12:28 PM, Ben Grasset via fpc-pascal <
> fpc-pascal@lists.freepascal.org> wrote:
> >
> >   {$IF GetTypeKind(T) in [tkInteger, tkInt64, tkQWord]}
> >     Result := A div B
> >   {$ELSEIF GetTypeKind(T) = tkFloat}
> >     Result := A / B
> >   {$ELSE}
> >     Result := Default(T);
> >   {$ENDIF}
>
> This is what I hinted in my post.  Has anything like this been considered
> before? It seems necessary to me but it looks like Sven had some fancy work
> around using pointers. Either way the compile time directive would be
> faster and avoid the conditional statements.
>

The token recorder does not support preprocessor conditions. Not to mention
that this mixes preprocessor and parser stuff. Generics are part of the
parser.

Regards,
Sven

>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to