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
TImage colors incorrect
by
Jonny
[
Today
at 01:24:06 am]
Nested declarations insid...
by
Joanna from IRC
[
Today
at 01:03:01 am]
MQTT Client
by
dbannon
[
Today
at 12:07:40 am]
Programs writing programs...
by
Curt Carpenter
[
Today
at 12:06:18 am]
Using Masurement Computin...
by
Sander
[January 17, 2025, 11:33:30 pm]
A Tip for beginners
by
Ten_Mile_Hike
[January 17, 2025, 11:10:10 pm]
FPC 3.2.4, naming suggest...
by
JuhaManninen
[January 17, 2025, 10:39:58 pm]
Lazarus Release Candidate...
by
verasan
[January 17, 2025, 10:25:58 pm]
VGM Player
by
Gigatron2
[January 17, 2025, 09:29:09 pm]
Artificial intelligence
by
Fred vS
[January 17, 2025, 07:57:53 pm]
How to avoid copying
by
Amir61
[January 17, 2025, 07:55:16 pm]
UnoLib - library in Pasca...
by
ackarwow
[January 17, 2025, 07:25:40 pm]
Bug in the formula MATCH
by
wp
[January 17, 2025, 06:38:31 pm]
Restoring minimized scree...
by
Thaddy
[January 17, 2025, 06:31:25 pm]
Problem in writing formul...
by
wp
[January 17, 2025, 06:16:53 pm]
Preparing FPC 3.2.4, poin...
by
lainz
[January 17, 2025, 02:29:45 pm]
LCL Web Native with D2Bri...
by
BlueIcaro
[January 17, 2025, 01:06:25 pm]
Connection issues, contin...
by
Zvoni
[January 17, 2025, 12:48:24 pm]
Order of dialog buttons?
by
dsiders
[January 17, 2025, 11:16:21 am]
Where do I get IdHTTP, ...
by
Remy Lebeau
[January 17, 2025, 10:35:12 am]
Output directory for exe
by
d2010
[January 17, 2025, 10:22:51 am]
Debugging a new package?
by
Martin_fr
[January 17, 2025, 10:13:05 am]
Making sense of pparser, ...
by
JernejL
[January 17, 2025, 09:46:54 am]
CPU-View
by
Alexander (Rouse_) Bagel
[January 17, 2025, 09:36:12 am]
TIdSMTP problems
by
Remy Lebeau
[January 17, 2025, 09:30:03 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 840 times)
Okoba
Hero Member
Posts: 572
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: 10665
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: 572
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: 10665
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: 572
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