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
Fixing Lazarus 4.4 IDE la...
by
Curt Carpenter
[
Today
at 06:47:29 pm]
TRichMemo EM_FORMATRANGE ...
by
rvk
[
Today
at 06:39:30 pm]
The Future of FPC
by
LeP
[
Today
at 06:29:43 pm]
Lazarus recompiles some o...
by
Bart
[
Today
at 06:17:29 pm]
TaChart on MAC: No nice s...
by
tk
[
Today
at 06:10:50 pm]
[ANN] fpGUI Toolkit v2.0....
by
cdbc
[
Today
at 05:58:53 pm]
External SIGSEV (Database...
by
cdbc
[
Today
at 05:37:46 pm]
Status of FPC 3.4.0 or FP...
by
Fred vS
[
Today
at 05:31:05 pm]
it2play - IT/S3M module r...
by
hukka
[
Today
at 04:59:35 pm]
Fast Canvas Library V1.05...
by
Gigatron
[
Today
at 04:40:04 pm]
TLazSerial : serial port ...
by
tetrastes
[
Today
at 03:39:07 pm]
Z80 ZX Spectrum and Syste...
by
Cascade
[
Today
at 03:30:13 pm]
Debian removes FPC/Lazaru...
by
Fred vS
[
Today
at 12:19:14 pm]
Where is Lazarus config
by
Martin_fr
[
Today
at 12:10:36 pm]
Anchordocking - window pr...
by
Zvoni
[
Today
at 10:41:04 am]
How to determine the unkn...
by
Hartmut
[
Today
at 09:56:10 am]
ThorVG - test (lightweigh...
by
Boleeman
[
Today
at 09:34:56 am]
Anchordocking - Window T...
by
janhsh
[
Today
at 09:33:09 am]
Free Pascal for a small e...
by
dbannon
[
Today
at 09:20:55 am]
Problem with Generic Cons...
by
SonnyBoyXXl
[
Today
at 07:59:15 am]
[SHARE] Rotate and Flip b...
by
Xenno
[
Today
at 07:37:56 am]
Pre-Specialize Generic Fu...
by
Khrys
[
Today
at 07:02:30 am]
[ANN] PasBuild 1.2.0 Rele...
by
Graeme
[February 09, 2026, 11:34:03 pm]
[SOLVED] TFPGObjectList s...
by
Phoenix
[February 09, 2026, 11:18:33 pm]
ListBox MeasureItem
by
TheCompanionCube
[February 09, 2026, 08:43:49 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 1125 times)
Okoba
Hero Member
Posts: 648
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: 12099
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: 648
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: 12099
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: 648
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