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
Api/component pack for Ra...
by
pascalbythree
[
Today
at 02:13:34 pm]
Wrong resolution of secon...
by
rvk
[
Today
at 02:12:01 pm]
Benchmarks
by
Warfley
[
Today
at 02:00:39 pm]
Breakpoint dosn't work
by
Martin_fr
[
Today
at 01:13:30 pm]
[Solved]I have created dl...
by
Packs
[
Today
at 01:11:27 pm]
TLazSerial : serial port ...
by
tetrastes
[
Today
at 12:26:29 pm]
Common File Dialogs Have ...
by
rvk
[
Today
at 10:39:59 am]
Bright color
by
Warfley
[
Today
at 10:29:06 am]
kernel 6.8 and checking s...
by
MarkMLl
[
Today
at 10:28:12 am]
Inversive Geometry Curves...
by
Boleeman
[
Today
at 09:18:47 am]
compiler messages suggest...
by
ackarwow
[
Today
at 08:38:17 am]
[Solved] pointer to out o...
by
440bx
[
Today
at 12:51:22 am]
storing string
by
ASerge
[December 04, 2024, 11:06:57 pm]
Show Form at Top
by
n7800
[December 04, 2024, 10:16:21 pm]
Arrow keys in FV
by
HotShoe
[December 04, 2024, 10:04:56 pm]
"Active $IFDEF code" is r...
by
MarkMLl
[December 04, 2024, 09:49:15 pm]
NSHapticFeedbackPerformer
by
msintle
[December 04, 2024, 09:47:25 pm]
[SOLVED] Howto use a DEFI...
by
MarkMLl
[December 04, 2024, 09:43:08 pm]
Use tts0, This example is...
by
coradi
[December 04, 2024, 09:37:12 pm]
Library for XSLT 2.0 Tran...
by
ebizz
[December 04, 2024, 06:54:35 pm]
How to know when dragging...
by
Aistis
[December 04, 2024, 06:41:46 pm]
Problem with Hints
by
Handoko
[December 04, 2024, 04:37:21 pm]
SetLength fall
by
LemonParty
[December 04, 2024, 03:29:35 pm]
Feature Request for TMapV...
by
EkkehardDomning
[December 04, 2024, 03:23:27 pm]
The Silver Coder on YouTu...
by
silvercoder70
[December 04, 2024, 11:45:36 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set of Enum in generic (Read 807 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: 10550
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: 10550
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