On Tue, Jul 16, 2019 at 8:35 AM Michael Van Canneyt
wrote:
> 2. The Low(T) does not work, as there is no way to tell Delphi that T must
> be an enum.
>
Hmm, I guess it makes sense Delphi wouldn't allow the "Low", based on other
Delphi generics behavior (more like C#, whereas FPC is more like
Michael Van Canneyt schrieb am Di., 16. Juli 2019,
16:31:
>
>
> On Tue, 16 Jul 2019, Ben Grasset wrote:
>
> > On Tue, Jul 16, 2019 at 5:28 AM Sven Barth via fpc-devel <
> > fpc-devel@lists.freepascal.org> wrote:
> >
> >> The output will then be two different addresses, thus showing that the
> >>
On Tue, 16 Jul 2019, Ben Grasset wrote:
On Tue, Jul 16, 2019 at 5:28 AM Sven Barth via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
The output will then be two different addresses, thus showing that the
code had been generated twice.
However the compiler/linker is good at leaving out
On Tue, Jul 16, 2019 at 5:28 AM Sven Barth via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
> The output will then be two different addresses, thus showing that the
> code had been generated twice.
>
> However the compiler/linker is good at leaving out unused code and in this
> case only
On Sat, 13 Jul 2019, Ben Grasset wrote:
On Sat, Jul 13, 2019 at 2:37 PM Ondrej Pokorny wrote:
I do exactly the same - check the low/high bounds in a type helper :)
Yes, and I am tired of typing it as well :)
You can pretty easily write a generic function that will work on pretty
much
Ben Grasset schrieb am Mo., 15. Juli 2019, 23:48:
> On Mon, Jul 15, 2019 at 5:23 PM Sven Barth via fpc-devel <
> fpc-devel@lists.freepascal.org> wrote:
>
>> That is exactly what is happening if you have a specialization in
>> multiple units that don't know about each other.
>>
>
> At what point
Ben Grasset schrieb am Di., 16. Juli 2019, 00:13:
> On Mon, Jul 15, 2019 at 5:50 PM Michael Van Canneyt <
> mich...@freepascal.org> wrote:
>
>> As far as I know, they are not. I believe that when specializing, the
>> compiler checks if an identical specialization is in scope:
>> if so, it uses
Michael Van Canneyt schrieb am Mo., 15. Juli 2019,
23:50:
>
>
> On Mon, 15 Jul 2019, Ben Grasset wrote:
>
> > On Mon, Jul 15, 2019 at 5:23 PM Sven Barth via fpc-devel <
> > fpc-devel@lists.freepascal.org> wrote:
> >
> >> That is exactly what is happening if you have a specialization in
>
Nihao,
On Sat, Jul 13, 2019 at 01:52:46PM +0200, Michael Van Canneyt wrote:
> On Sat, 13 Jul 2019, Jonas Maebe wrote:
> > On 13/07/2019 13:28, J. Gareth Moreton wrote:
> > [...]
> >
> > Declare your enumation types so that the lowest and highest valid value
> > comprise the lowest and highest