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
Un-register an LCL Compon...
by
dbannon
[
Today
at 04:58:57 am]
[SOLVED] TPanel slider po...
by
Handoko
[
Today
at 04:07:12 am]
Windows API and wide/unic...
by
Nadar
[
Today
at 03:41:56 am]
how to change color of a ...
by
Handoko
[
Today
at 03:26:35 am]
Date-Stamp DBDateEdit
by
Handoko
[
Today
at 03:16:12 am]
Chinese input in edit and...
by
myisjwj
[
Today
at 03:13:57 am]
Any library to generate a...
by
Martin_fr
[
Today
at 01:29:56 am]
Sleep forever
by
440bx
[
Today
at 01:12:57 am]
Absolute positioning of c...
by
dseligo
[
Today
at 01:06:11 am]
Lazarus 3.0 on linux does...
by
dbannon
[
Today
at 12:46:02 am]
BGRA Controls
by
andrew Bubble
[November 29, 2023, 11:44:33 pm]
Online Package Manager
by
lainz
[November 29, 2023, 10:34:18 pm]
BGRA Controls Install Lat...
by
andrew Bubble
[November 29, 2023, 08:43:54 pm]
What is the meaning of TF...
by
Hartmut
[November 29, 2023, 05:35:18 pm]
ImGui FreePascal Binding ...
by
Coldzer0
[November 29, 2023, 05:28:50 pm]
Can't build a project gro...
by
MarkMLl
[November 29, 2023, 05:22:14 pm]
TFileStream.ReadAnsiStrin...
by
simone
[November 29, 2023, 05:16:57 pm]
Why cannot this be inline...
by
Stefan Glienke
[November 29, 2023, 05:05:12 pm]
TPath enhancements (Issue...
by
VisualLab
[November 29, 2023, 04:47:46 pm]
jwabcrypt unit is missing
by
fpc_2024
[November 29, 2023, 03:08:24 pm]
Problems with accentuatio...
by
Gercino
[November 29, 2023, 02:47:54 pm]
Lazarus Install PI5 Bookw...
by
paweld
[November 29, 2023, 01:36:00 pm]
Conscious Artificial Inte...
by
Dzandaa
[November 29, 2023, 01:07:14 pm]
BGRABitmap - showcase -
by
Mongkey
[November 29, 2023, 11:14:36 am]
Patt - a small ball bounc...
by
thehay95
[November 29, 2023, 11:06:17 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 330 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