Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
Call a template function
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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Lazarus Bugfix Release 4....
by
n7800
[
Today
at 10:59:09 pm]
Can not load postgres cli...
by
martinm
[
Today
at 10:17:31 pm]
I have made some progress...
by
zeljko
[
Today
at 08:23:17 pm]
Gtk3 widgetset - call for...
by
zeljko
[
Today
at 08:21:54 pm]
an error occurred while c...
by
Seenkao
[
Today
at 07:29:14 pm]
Indy10 hangs the app if u...
by
LeP
[
Today
at 07:28:12 pm]
FPC Unleashed (async/awai...
by
Thaddy
[
Today
at 05:43:19 pm]
RichMemo and GTK3
by
dsiders
[
Today
at 05:15:45 pm]
Desktop Shortcut
by
J-G
[
Today
at 04:49:33 pm]
ProDAW
by
jamie
[
Today
at 04:14:20 pm]
Which quantized model wor...
by
LeP
[
Today
at 04:12:28 pm]
[ANN] fpGUI Toolkit v2.1....
by
cdbc
[
Today
at 01:41:07 pm]
Ask AI to make fast HEX t...
by
paweld
[
Today
at 01:23:08 pm]
Isn’t this funny?
by
backprop
[
Today
at 12:25:46 pm]
Windows Installer with FP...
by
Martin_fr
[
Today
at 07:42:28 am]
GTK3 is now the default w...
by
dbannon
[
Today
at 03:25:30 am]
Parsing error?
by
jlinux
[
Today
at 02:15:42 am]
Putting a new file on a w...
by
J-G
[July 18, 2026, 11:10:43 pm]
[SOLVED]Problem with Mari...
by
Tomu
[July 18, 2026, 10:49:15 pm]
debugger error
by
Martin_fr
[July 18, 2026, 10:38:42 pm]
TCHATGPT — An Artificial ...
by
schuler
[July 18, 2026, 10:00:48 pm]
Slow app start on M5 MacB...
by
Thaddy
[July 18, 2026, 08:16:52 pm]
Peculiarities in the EXE ...
by
Thaddy
[July 18, 2026, 07:49:45 pm]
Windows 2026_7 update and...
by
Martin_fr
[July 18, 2026, 06:23:32 pm]
KOL4 Beta available.
by
Thaddy
[July 18, 2026, 06:23:08 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Call a template function (Read 522 times)
LemonParty
Hero Member
Posts: 562
Call a template function
«
on:
August 13, 2025, 07:46:33 pm »
Hello.
I have function
Code: Pascal
[Select]
[+]
[-]
function
FirstInSet<T
{:set}
>
(
aSet
:
T
)
:
SizeUInt
;
inline
;
I trying to call it this way:
Code: Pascal
[Select]
[+]
[-]
FirstInSet
(
MySet
)
;
And I getting error
Quote
Error: Wrong number of parameters specified for call to "FirstInSet"
What I doing wrong?
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Warfley
Hero Member
Posts: 2071
Re: Call a template function
«
Reply #1 on:
August 13, 2025, 08:26:03 pm »
In mode ObjFPC:
Code: Pascal
[Select]
[+]
[-]
specialize FirstInSet<TMySetType>
(
MySet
)
;
in mode Delphi
Code: Pascal
[Select]
[+]
[-]
FirstInSet<TMySetType>
(
MySet
)
;
Logged
GitHub:
https://github.com/Warfley
LemonParty
Hero Member
Posts: 562
Re: Call a template function
«
Reply #2 on:
August 13, 2025, 09:15:37 pm »
It works. Thank you.
Logged
Lazarus v. 4.99. FPC v. 3.3.1. Windows 11
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
Call a template function
TinyPortal
© 2005-2018