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
IRC channel
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
TPanel slider position
by
Handoko
[
Today
at 04:08:45 am]
Online Package Manager
by
Remy Lebeau
[
Today
at 04:00:20 am]
Is there an indexable str...
by
jamie
[
Today
at 03:44:14 am]
Un-register an LCL Compon...
by
dbannon
[
Today
at 03:28:20 am]
[SOLVED]Bash commands and...
by
TRon
[
Today
at 02:52:35 am]
TAnchorDockPanel - Save a...
by
kapibara
[
Today
at 01:35:51 am]
Error: -macosx_version_mi...
by
Koenijn
[
Today
at 01:28:52 am]
Interesting work on Unive...
by
WayneSherman
[
Today
at 12:58:30 am]
How to 'Hello world' on l...
by
wp
[
Today
at 12:44:08 am]
How to force Event String...
by
wp
[December 02, 2023, 11:19:09 pm]
Two paintbox, how to set ...
by
VisualLab
[December 02, 2023, 10:54:37 pm]
IsWayland value can be ca...
by
AlexTP
[December 02, 2023, 10:11:17 pm]
Rotate image
by
Onur2x
[December 02, 2023, 09:21:07 pm]
Date-Stamp DBDateEdit
by
1HuntnMan
[December 02, 2023, 09:01:03 pm]
unable to rebuild Lazarus
by
cdbc
[December 02, 2023, 07:34:34 pm]
TStringGrid color cells w...
by
Hansvb
[December 02, 2023, 07:16:36 pm]
Mac OS 3.0RC2 throws __da...
by
Jonas Maebe
[December 02, 2023, 05:26:39 pm]
i can't inatall Dam dialo...
by
majid.ebru
[December 02, 2023, 05:00:57 pm]
Noting responds when send...
by
ccrause
[December 02, 2023, 04:47:27 pm]
How to detect uninitialis...
by
jamie
[December 02, 2023, 04:20:00 pm]
TCustomShellTreeView.GetF...
by
wp
[December 02, 2023, 03:43:58 pm]
Gtk2 small patch for focu...
by
parcel
[December 02, 2023, 03:32:44 pm]
Winsoft libraries
by
Mark20
[December 02, 2023, 03:12:49 pm]
Not able to add any compo...
by
andrew Bubble
[December 02, 2023, 02:46:49 pm]
[SOLVED] TFPHTTPClient.Ge...
by
Thaddy
[December 02, 2023, 02:30:18 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 336 times)
Okoba
Sr. Member
Posts: 478
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: 9354
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
Sr. Member
Posts: 478
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: 9354
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
Sr. Member
Posts: 478
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