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
Dymo label writers
by
fred
[
Today
at 11:00:42 am]
Interesting article about...
by
Joanna from IRC
[
Today
at 10:56:25 am]
Adding interfaces to any ...
by
Warfley
[
Today
at 10:42:20 am]
Application deployment
by
Warfley
[
Today
at 10:30:39 am]
[SOLVED] TRichMemo and te...
by
CM630
[
Today
at 08:18:36 am]
Animated GIF's and Lazaru...
by
Khrys
[
Today
at 06:49:15 am]
Bug in string concatenati...
by
Remy Lebeau
[
Today
at 06:33:49 am]
Any support for Perpendic...
by
SandyG
[
Today
at 05:34:10 am]
uMain.pas(150,29) Error: ...
by
dseligo
[
Today
at 01:53:00 am]
TvsComPort on MacOS Sierr...
by
Jurassic Pork
[
Today
at 01:48:33 am]
Starting a program with h...
by
jeremiah
[
Today
at 12:58:26 am]
fphttpclient https/tls on...
by
fireboxsoft
[
Today
at 12:38:12 am]
Q: Debug a plugin DLL: 'h...
by
Martin_fr
[
Today
at 12:32:43 am]
The Silver Coder on YouTu...
by
silvercoder70
[December 12, 2024, 11:42:06 pm]
crash db navigator with L...
by
wp
[December 12, 2024, 11:07:46 pm]
Common File Dialogs Have ...
by
dsiders
[December 12, 2024, 11:02:19 pm]
[Solved] Crosshair error ...
by
wp
[December 12, 2024, 10:45:16 pm]
Datatypes Interoperabilit...
by
BSaidus
[December 12, 2024, 09:36:52 pm]
Component Installation
by
msch
[December 12, 2024, 09:31:43 pm]
Who catches the Linux sig...
by
PascalDragon
[December 12, 2024, 09:10:40 pm]
Bot moderator for large g...
by
Renat.Su
[December 12, 2024, 09:09:31 pm]
FPC port to 9front
by
PascalDragon
[December 12, 2024, 09:00:02 pm]
Wiki, a dead link in page...
by
d7_2_laz
[December 12, 2024, 08:47:40 pm]
lazarus 4.0 RC1 error
by
Martin_fr
[December 12, 2024, 08:06:35 pm]
Help Needed With FPHTTPCl...
by
AaronCatolico1
[December 12, 2024, 06:46:06 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 811 times)
Okoba
Hero Member
Posts: 555
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: 10557
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: 555
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: 10557
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: 555
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