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
Lazarus Release Candidate...
by
dbannon
[
Today
at 01:00:57 am]
Copying records with dyna...
by
McDoob
[
Today
at 12:28:29 am]
UK's Online Safety Act
by
Joanna from IRC
[
Today
at 12:22:44 am]
TDBEdit uneditable
by
korba812
[
Today
at 12:19:36 am]
constref and assembler x6...
by
ASerge
[January 24, 2025, 11:50:46 pm]
Synedit wordwrap
by
Martin_fr
[January 24, 2025, 10:26:36 pm]
application->terminate ma...
by
MarkMLl
[January 24, 2025, 09:42:14 pm]
Lazarus Bugfix Release 3....
by
Martin_fr
[January 24, 2025, 09:38:45 pm]
Drawing with psInsidefram...
by
Jonny
[January 24, 2025, 08:20:18 pm]
AVRPascal – free code edi...
by
ackarwow
[January 24, 2025, 07:49:52 pm]
Threads window (in Debug ...
by
erol
[January 24, 2025, 06:31:17 pm]
Help with tablayout.getti...
by
Narciso
[January 24, 2025, 05:29:43 pm]
مشكلة في التقارير
by
Gebo
[January 24, 2025, 05:25:14 pm]
Conditional variable defi...
by
TRon
[January 24, 2025, 04:50:00 pm]
Result not being set in c...
by
Thaddy
[January 24, 2025, 03:09:12 pm]
Problem with TTabControl
by
MISV
[January 24, 2025, 02:12:53 pm]
Getting format error load...
by
MISV
[January 24, 2025, 02:07:44 pm]
How C++ class multiple in...
by
Thaddy
[January 24, 2025, 01:39:03 pm]
Guide Lines Behavior
by
GerholdtSchnaps
[January 24, 2025, 01:35:16 pm]
Fpcupdeluxe
by
DonAlfredo
[January 24, 2025, 12:53:33 pm]
Return nil/null of data t...
by
Warfley
[January 24, 2025, 12:51:48 pm]
FPHTTPClient and SSL not ...
by
Thaddy
[January 24, 2025, 12:45:01 pm]
Painting on a control - 3...
by
majolika
[January 24, 2025, 11:06:26 am]
Amigo programming languag...
by
paxscript
[January 24, 2025, 10:05:39 am]
Exclude Jedi Code Formatt...
by
JuhaManninen
[January 24, 2025, 06:13:54 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 846 times)
Okoba
Hero Member
Posts: 573
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: 10696
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: 573
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: 10696
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: 573
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