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
TSynCompletion filtering ...
by
Wesbat
[
Today
at 10:44:41 pm]
How make the GUI as one p...
by
dsiders
[
Today
at 10:40:29 pm]
Current GTK2 and GTK3 Sta...
by
dsiders
[
Today
at 10:34:47 pm]
Starting a program with h...
by
jeremiah
[
Today
at 10:02:03 pm]
AVRPascal – free code edi...
by
ackarwow
[
Today
at 10:00:42 pm]
Button opens terminal (Li...
by
MarkMLl
[
Today
at 09:36:48 pm]
Animated GIF's and Lazaru...
by
Aruna
[
Today
at 09:31:37 pm]
How to copy file to web
by
bobonwhidbey
[
Today
at 09:20:16 pm]
Interesting article about...
by
440bx
[
Today
at 08:58:24 pm]
[Solved] Q: Debug a plugi...
by
d7_2_laz
[
Today
at 08:10:13 pm]
[Solved] TCheckGroup Chil...
by
TheLastCayen
[
Today
at 07:43:50 pm]
NSHapticFeedbackPerformer
by
msintle
[
Today
at 07:35:29 pm]
Another way to search the...
by
Handoko
[
Today
at 07:24:17 pm]
SDL2 Fit image rotation b...
by
Pe3s
[
Today
at 07:18:57 pm]
SAVE StringGrid to PDF
by
dseligo
[
Today
at 06:50:20 pm]
Error: External: FLT INVA...
by
krzynio
[
Today
at 06:23:56 pm]
Specializing a generic of...
by
Okoba
[
Today
at 05:26:07 pm]
[SOLVED] Classic objects ...
by
flowCRANE
[
Today
at 05:25:15 pm]
C operators and shift
by
VisualLab
[
Today
at 05:20:20 pm]
Lazarus for Windows on aa...
by
PascalDragon
[
Today
at 03:32:02 pm]
Common File Dialogs Have ...
by
rvk
[
Today
at 02:39:17 pm]
DBGrid editing control
by
silvercoder70
[
Today
at 12:43:29 pm]
IFS Fractals: Iterating t...
by
Joanna from IRC
[
Today
at 11:41:26 am]
Unwanted additional line ...
by
CM630
[
Today
at 08:55:13 am]
MainMenu: How to use the ...
by
rich2014
[
Today
at 02:45:31 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 813 times)
Okoba
Hero Member
Posts: 558
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: 10564
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: 558
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: 10564
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: 558
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