Thanks to both for the explanation. I see it now.<br><br>And thanks Sven dfor the note about the ETA of the generic functions/methods.<br><br>In the meantime I will see if I can do it in some other way.<br><br>Best regards, <br>
David<br><br><div class="gmail_quote">2012/5/19 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 19.05.2012 12:58, Kornel Kisielewicz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, May 19, 2012 at 10:50 AM, David Ballesteros<<a href="mailto:dballesg@gmail.com" target="_blank">dballesg@gmail.com</a><u></u>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I'm trying to port a C/C++ SDK from an application to a Pascal Wrapper using<br>
FPC 2.7.1. from SVN.<br>
<br>
I have a templated fucntion on the C++ code that I will like to translate, I<br>
know Generic classes are more or less working on the FPC SVN.<br>
<br>
To my surprise this two lines of code doesn't produce any compiling errors:<br>
<br>
type<br>
generic test<M,N> = procedure( m1 : M; n1 : N);<br>
generic test2<M,N> = function( m1 : M; n1 : N): Boolean;<br>
<br>
But how to write the implementation?<br>
<br>
This means the FPC parser understand it but they will not compile?<br>
</blockquote>
<br>
That's not surprising at all. What you are doing here is defining a<br>
generic of a procedural variable type. Hence this is only useful to<br>
specialize to a given type (which is useful in some generic classes,<br>
for example to define a sorter function in a linear container). That<br>
is a completely different situation than defining a generic procedure<br>
itself. That is as yet (as far as I know) not possible.<br>
</blockquote>
<br></div>
Completely correct. Only one thing to add from my side:<br>
<br>
I hope to start the implementation of generic functions/methods in this year.<br>
<br>
Regards,<br>
Sven<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org" target="_blank">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/<u></u>mailman/listinfo/fpc-devel</a><br>
</div></div></blockquote></div><br>