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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
how to control the order ...
by
mas steindorff
[
Today
at 02:26:16 am]
[SOLVED] FPSpreadSheet, ...
by
TRon
[
Today
at 01:25:51 am]
Is it possible to do git ...
by
TRon
[
Today
at 12:41:39 am]
Interesting article about...
by
Joanna from IRC
[
Today
at 12:41:28 am]
had a question and found ...
by
TRon
[
Today
at 12:36:57 am]
Draw Transparent Fill Rec...
by
LBox
[
Today
at 12:00:51 am]
Wiki, a dead link in page...
by
d7_2_laz
[December 09, 2024, 10:53:21 pm]
MIDI commands
by
TRon
[December 09, 2024, 10:43:22 pm]
Record "inheritance"/stru...
by
PascalDragon
[December 09, 2024, 10:31:25 pm]
Who catches the Linux sig...
by
LV
[December 09, 2024, 09:47:15 pm]
FreePascal version of gcc...
by
PascalDragon
[December 09, 2024, 09:45:02 pm]
Lazarus for Windows on aa...
by
PascalDragon
[December 09, 2024, 09:21:38 pm]
SAVE StringGrid to PDF
by
dseligo
[December 09, 2024, 07:42:30 pm]
ColorDialog can have opti...
by
Bart
[December 09, 2024, 06:07:24 pm]
Hustle - A simple task ma...
by
BSaidus
[December 09, 2024, 04:58:15 pm]
Notepad++ plugin with doc...
by
d7_2_laz
[December 09, 2024, 04:07:14 pm]
TLazSerial : serial port ...
by
CM630
[December 09, 2024, 04:05:20 pm]
MainMenu: How to use the ...
by
madref
[December 09, 2024, 03:39:05 pm]
Program running on after ...
by
MarkMLl
[December 09, 2024, 03:23:45 pm]
Array of String lookup gi...
by
jcmontherock
[December 09, 2024, 11:50:47 am]
The Silver Coder on YouTu...
by
silvercoder70
[December 09, 2024, 11:49:09 am]
Api/component pack for Ra...
by
cdbc
[December 09, 2024, 11:43:17 am]
How to know when dragging...
by
Aistis
[December 09, 2024, 10:41:22 am]
BASS DLL
by
d2010
[December 09, 2024, 07:47:33 am]
[Solved]Printing unicode ...
by
bobonwhidbey
[December 09, 2024, 05:23:56 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 810 times)
Okoba
Hero Member
Posts: 555
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: 10553
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
Hero Member
Posts: 555
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: 10553
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
Hero Member
Posts: 555
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