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
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Where are you from?
by
Martin_fr
[
Today
at 03:43:44 pm]
Is Lazarus' Tool Palette ...
by
Martin_fr
[
Today
at 03:05:11 pm]
[hacked for now] Changing...
by
jamie
[
Today
at 02:57:58 pm]
Why does the call via fun...
by
Warfley
[
Today
at 02:17:38 pm]
About the Class View
by
wp
[
Today
at 01:58:25 pm]
Hint on axis marks
by
wp
[
Today
at 01:35:13 pm]
Lazarus is not working
by
Fred vS
[
Today
at 01:22:23 pm]
TLazSerial : serial port ...
by
CM630
[
Today
at 12:24:27 pm]
Qt6 / X11: problem with G...
by
dbannon
[
Today
at 10:51:56 am]
connecting to mariadb
by
Zvoni
[
Today
at 08:20:31 am]
Question re. FCL's ssocke...
by
Khrys
[
Today
at 07:00:32 am]
Status of Missile Command...
by
TBMan
[
Today
at 03:42:52 am]
Does FreePascal have a WM...
by
CM630
[December 15, 2025, 11:20:24 pm]
AVRPascal – free code edi...
by
ackarwow
[December 15, 2025, 10:40:17 pm]
delete cookies
by
Leledumbo
[December 15, 2025, 05:14:27 pm]
Error: Enumeration symbol...
by
nanobit
[December 15, 2025, 04:17:38 pm]
AI interactions
by
Zvoni
[December 15, 2025, 02:19:48 pm]
Recomendations for conver...
by
kompustelnik
[December 15, 2025, 11:20:05 am]
[Solved] Lookup field: er...
by
BlueIcaro
[December 15, 2025, 09:59:57 am]
LCL Web Native with D2Bri...
by
egsuh
[December 15, 2025, 08:10:14 am]
Access Violation - Databa...
by
Xenno
[December 15, 2025, 06:21:52 am]
SpkToolbar custom update
by
wp
[December 14, 2025, 11:55:55 pm]
MVP made easier.
by
cdbc
[December 14, 2025, 05:14:40 pm]
TIBDataSet "Closing"? on ...
by
RedOctober
[December 14, 2025, 04:52:18 pm]
Running External Tools
by
JuhaManninen
[December 14, 2025, 04:08:28 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 1086 times)
Okoba
Hero Member
Posts: 621
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: 11931
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
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
Okoba
Hero Member
Posts: 621
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: 11931
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
Ide Tools, Code completion and more
/
IDE cool features
/
Debugger Status
Okoba
Hero Member
Posts: 621
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