Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
General
(Moderators:
FPK
,
Tomas Hajny
) »
Set of Enum in generic
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
LAMW 0.8.6.3
by
WayneSherman
[
Today
at 07:06:44 pm]
[SOLVED] SVG thumbnails
by
Pe3s
[
Today
at 07:06:40 pm]
GetFTime. What is correct...
by
jamie
[
Today
at 06:51:29 pm]
BGRASpriteAnimation - Fra...
by
pixelink
[
Today
at 06:42:22 pm]
How to detect if an UTF8-...
by
Hartmut
[
Today
at 06:22:15 pm]
try except fails inside w...
by
ad1mt
[
Today
at 05:41:53 pm]
Possible bug with range c...
by
Paolo
[
Today
at 05:38:23 pm]
Feedback on Int128 unit r...
by
ad1mt
[
Today
at 05:37:32 pm]
Problem with typing Shift...
by
AlexTP
[
Today
at 05:33:25 pm]
Open Source Program I hav...
by
vonskie
[
Today
at 05:20:58 pm]
Terminal shows warnings i...
by
zeljko
[
Today
at 05:12:52 pm]
Anyone use sqlcipher with...
by
vonskie
[
Today
at 05:09:57 pm]
Writing error when select...
by
TRon
[
Today
at 04:27:24 pm]
Inc operator overloading ...
by
jamie
[
Today
at 02:53:46 pm]
Compile loongarch64 appli...
by
myisjwj
[
Today
at 02:12:01 pm]
Display Software License ...
by
1HuntnMan
[
Today
at 01:46:01 pm]
Help shortcut disappeared
by
apeoperaio
[
Today
at 12:50:32 pm]
Why does calling CheckSyn...
by
a8265348
[
Today
at 12:13:11 pm]
Demo example. How work wi...
by
ginoo
[
Today
at 10:58:08 am]
LAMW: Green dot always ap...
by
Daydreamer
[
Today
at 10:52:09 am]
SELECT - Criar sequencial...
by
Zvoni
[
Today
at 10:24:28 am]
likely/unlikely — will it...
by
marcov
[
Today
at 10:05:59 am]
Better Vectorcall Support
by
marcov
[
Today
at 09:39:31 am]
lazarus controlling compi...
by
Чебурашка
[
Today
at 08:39:16 am]
Program crashes on Window...
by
avra
[
Today
at 07:22:42 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 351 times)
Okoba
Sr. Member
Posts: 479
Set of Enum in generic
«
on:
October 01, 2023, 06:23:20 pm »
Is there a way to declare a new set of an enum in a generic function? This function only specializes with enum types and I do not want to make a set for each.
Code: Pascal
[Select]
[+]
[-]
type
TEnum
=
(
A
,
B
,
C
)
;
procedure
Test<T>
(
E
:
T
)
;
type
S1
=
set
of
TEnum
;
S2
=
set
of
T
;
//Error
begin
end
;
Logged
Martin_fr
Administrator
Hero Member
Posts: 9390
Debugger - SynEdit - and more
Re: Set of Enum in generic
«
Reply #1 on:
October 01, 2023, 06:25:41 pm »
Maybe
Code: Pascal
[Select]
[+]
[-]
S2
=
set
of
low
(
t
)
..
high
(
t
)
;
Logged
From the wiki:
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
Okoba
Sr. Member
Posts: 479
Re: Set of Enum in generic
«
Reply #2 on:
October 01, 2023, 06:27:55 pm »
That works!
Should I report the first one as an issue?
Logged
Martin_fr
Administrator
Hero Member
Posts: 9390
Debugger - SynEdit - and more
Re: Set of Enum in generic
«
Reply #3 on:
October 01, 2023, 06:29:37 pm »
Quote from: Okoba on October 01, 2023, 06:27:55 pm
That works!
Should I report the first one as an issue?
Some one from the FPC team needs to judge that.
Logged
From the wiki:
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
Okoba
Sr. Member
Posts: 479
Re: Set of Enum in generic
«
Reply #4 on:
October 01, 2023, 06:36:54 pm »
Thank you.
Reported:
https://gitlab.com/freepascal.org/fpc/source/-/issues/40453
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
General
(Moderators:
FPK
,
Tomas Hajny
) »
Set of Enum in generic
TinyPortal
© 2005-2018