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
Out of memory on a ATtiny...
by
ccrause
[
Today
at 07:16:29 pm]
TProcess and lots of data...
by
domasz
[
Today
at 06:33:14 pm]
What is the meaning of TF...
by
MarkMLl
[
Today
at 06:32:25 pm]
[SOLVED]Bash commands and...
by
TRon
[
Today
at 06:23:52 pm]
how to change color of a ...
by
Joanna
[
Today
at 04:28:17 pm]
Help with barcode scannin...
by
Handoko
[
Today
at 04:16:10 pm]
Noting responds when send...
by
pascalbythree
[
Today
at 03:36:40 pm]
Mediators and Indexed Pro...
by
Weitentaaal
[
Today
at 03:28:23 pm]
Windows API and wide/unic...
by
cdbc
[
Today
at 03:10:48 pm]
Better Vectorcall Support
by
Madoc
[
Today
at 02:09:07 pm]
Best practices to use tRt...
by
Mr.Madguy
[
Today
at 12:48:45 pm]
ImGui FreePascal Binding ...
by
Coldzer0
[
Today
at 12:44:00 pm]
Sleep forever
by
jollytall
[
Today
at 11:16:16 am]
LazReport designer math f...
by
nouzi
[
Today
at 10:26:26 am]
[SOLVED] Lazarus 3.0 on l...
by
Codrut1001
[
Today
at 10:25:08 am]
[SOLVED] Simple (I hope) ...
by
dbannon
[
Today
at 10:20:49 am]
Huge problem with open fi...
by
MarkMLl
[
Today
at 08:24:33 am]
BGRA Controls
by
paweld
[
Today
at 07:53:16 am]
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]
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]
Absolute positioning of c...
by
dseligo
[
Today
at 01:06:11 am]
Online Package Manager
by
lainz
[November 29, 2023, 10:34:18 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 332 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