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
How to port TArray.Sort?
by
domasz
[
Today
at 07:41:23 am]
Convert table to JSON arr...
by
paweld
[
Today
at 06:58:32 am]
Drawing a picture on the ...
by
paweld
[
Today
at 06:16:11 am]
application crashes on st...
by
guitarbug
[
Today
at 05:57:57 am]
Why is there no Chinese s...
by
PeterHu
[
Today
at 04:09:26 am]
tenchat
by
VictorPuche
[
Today
at 04:01:11 am]
Initialize list in functi...
by
PeterHu
[
Today
at 03:56:26 am]
Dynamic libraries in Linu...
by
Fred vS
[November 08, 2025, 10:28:42 pm]
What happens if you use "...
by
jamie
[November 08, 2025, 10:14:51 pm]
Unexpected lack of error ...
by
440bx
[November 08, 2025, 09:59:06 pm]
How detect a keypress in ...
by
creaothceann
[November 08, 2025, 09:37:38 pm]
FPC v3.2.2 internal error
by
440bx
[November 08, 2025, 09:15:48 pm]
Register global hotkey
by
LemonParty
[November 08, 2025, 09:05:25 pm]
Anyone interested in help...
by
Roland57
[November 08, 2025, 08:42:50 pm]
Distance of gridlines in ...
by
wp
[November 08, 2025, 08:08:14 pm]
CustomDraw package compil...
by
wp
[November 08, 2025, 06:54:28 pm]
Lazarus portable?
by
PascalDragon
[November 08, 2025, 06:29:28 pm]
FPC 3.2.4-rc1 available
by
PascalDragon
[November 08, 2025, 06:26:08 pm]
[SOLVED]FPHTTPServer with...
by
m.abudrais
[November 08, 2025, 06:18:26 pm]
How to implement uKey-bas...
by
PascalDragon
[November 08, 2025, 06:15:20 pm]
Parsing command line stri...
by
LemonParty
[November 08, 2025, 01:21:47 pm]
synedit
by
scasparz
[November 08, 2025, 10:05:25 am]
Get Out of Squircle Jail ...
by
Hansaplast
[November 08, 2025, 09:36:22 am]
Paradox date filter
by
bytebites
[November 08, 2025, 08:25:44 am]
head hurting - DBGrid Wor...
by
robertom
[November 08, 2025, 01:52:08 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 1026 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: 11795
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
Bright theme for bright minds
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: 11795
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
Bright theme for bright minds
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