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
How to "create" a TFont a...
by
Hartmut
[
Today
at 10:23:01 am]
Diferences in Generics in...
by
marcov
[
Today
at 10:12:34 am]
Does anybody have example...
by
pascalbythree
[
Today
at 10:05:16 am]
Lazarus IDE Windows "stuc...
by
nouzi
[
Today
at 09:39:11 am]
Sleep forever
by
MarkMLl
[
Today
at 09:29:07 am]
Huge problem with open fi...
by
dseligo
[
Today
at 09:13:25 am]
Store string in flash mem...
by
MarkMLl
[
Today
at 09:12:41 am]
Projects written in old F...
by
cdbc
[
Today
at 07:50:38 am]
LAMW: Print to network pr...
by
loaded
[
Today
at 07:15:30 am]
Lazarus Release Candidate...
by
dbannon
[
Today
at 06:20:12 am]
Why cannot this be inline...
by
Martin_fr
[
Today
at 02:10:55 am]
Does using TTimer creates...
by
Remy Lebeau
[
Today
at 02:06:10 am]
Android Auto app with LAM...
by
dsiders
[November 27, 2023, 11:32:10 pm]
Adding an icon to the exe...
by
hukka
[November 27, 2023, 09:06:26 pm]
Copy file with progress b...
by
Diverod
[November 27, 2023, 07:33:57 pm]
CopyToClipboard not worki...
by
dvhx
[November 27, 2023, 06:22:57 pm]
Dump list to tree view
by
d7_2_laz
[November 27, 2023, 06:02:14 pm]
Can we use custom drawn L...
by
bobby100
[November 27, 2023, 05:07:37 pm]
Windows low-level APIs an...
by
ArminLinder
[November 27, 2023, 04:32:19 pm]
Conscious Artificial Inte...
by
Dzandaa
[November 27, 2023, 03:50:13 pm]
How to override the capti...
by
wp
[November 27, 2023, 03:38:48 pm]
BGRABitmap - showcase -
by
Mongkey
[November 27, 2023, 11:20:36 am]
New version of BGRABitmap
by
nouzi
[November 27, 2023, 11:05:52 am]
Vectorcall and records
by
Madoc
[November 27, 2023, 10:04:19 am]
More TrayIcon Issues
by
dbannon
[November 27, 2023, 01:55:25 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 326 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: 9337
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: 9337
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