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
val return code
by
Paolo
[
Today
at 10:58:32 pm]
Gtk3 becomes default widg...
by
PascalDragon
[
Today
at 09:59:25 pm]
TCollection wiki entry
by
Thaddy
[
Today
at 08:48:54 pm]
UI app to work with SQLit...
by
Tomu
[
Today
at 07:55:20 pm]
Source Editor Collapsed P...
by
cdbc
[
Today
at 07:38:32 pm]
Seeking performance feedb...
by
Xenno
[
Today
at 04:31:34 pm]
Pls support Double Comman...
by
Alexx2000
[
Today
at 04:02:56 pm]
Ignoring Exceptions - Hit...
by
Martin_fr
[
Today
at 03:50:47 pm]
Lazarus 4.6 may erase you...
by
Benoni_Edin
[
Today
at 01:22:02 pm]
Greyed out controls?
by
LeP
[
Today
at 12:21:25 pm]
Creating binary
by
marcov
[
Today
at 11:25:17 am]
is there PDS reader/expor...
by
cdbc
[
Today
at 08:59:50 am]
Problems with creating a ...
by
Remy Lebeau
[
Today
at 06:28:22 am]
Hello. I'm new to this co...
by
onionmixer
[
Today
at 03:55:53 am]
Selecting from a list of ...
by
J-G
[July 09, 2026, 11:38:39 pm]
Help needed on how to do ...
by
paweld
[July 09, 2026, 10:06:31 pm]
A recreation of the class...
by
count
[July 09, 2026, 08:53:45 pm]
GTK3 is now the default w...
by
bonmario
[July 09, 2026, 07:48:59 pm]
using bass to play sounds
by
Thaddy
[July 09, 2026, 05:57:43 pm]
DDE
by
Thaddy
[July 09, 2026, 05:01:24 pm]
FPC Unleashed (async/awai...
by
Thaddy
[July 09, 2026, 04:38:17 pm]
String constants being di...
by
mihaisheng
[July 09, 2026, 12:25:38 pm]
[New Component] ExtTabCtr...
by
ovidio
[July 09, 2026, 09:12:56 am]
Best name for procedure
by
LemonParty
[July 08, 2026, 10:27:44 pm]
Using callback
by
LemonParty
[July 08, 2026, 08:50:29 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 1216 times)
Okoba
Hero Member
Posts: 660
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: 12512
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: 660
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: 12512
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: 660
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