ZeelandNet Webmail
I'm porting a piece of code from C++ and
there they use virtual inline methods. I tried it in FPC but it accepts either virtual OR inline methods. Is this a bug, or a feature that I don't understand enough about?
Regards, Darius

Mailing lists / fpc-pascal / 2011-08
5 messages · 4 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
ZeelandNet Webmail
I'm porting a piece of code from C++ and
there they use virtual inline methods. I tried it in FPC but it accepts either virtual OR inline methods. Is this a bug, or a feature that I don't understand enough about?
Regards, Darius
On 18 Aug 2011, at 17:08, <
FPC cannot inline virtual methods under any circumstances (even though in some special cases it would be theoretically possible, such as with final virtual methods or when using whole-program optimization), so it doesn't make sense to allow declaring them.
Jonas
ZeelandNet Webmail I'm porting a piece of code from C++ and there they use virtual inline…
2011/8/18 :
I'm porting a piece of code from C++ and there they use virtual inline methods. I tried it in FPC but it accepts either virtual OR inline methods. Is this a bug, or a feature that I don't understand enough about?
At first I didn't understand how a virtual function can be inlined (in C++), but after reading
http://msdn.microsoft.com/en-us/magazine/cc301407.aspx I understand.
I think fpc is not optimizing so much that it can detect when a virtual function can be inlined. But maybe WPO
(http://wiki.freepascal.org/Whole_Program_Optimization) can do something similar.
Vincent
ZeelandNet Webmail I'm porting a piece of code from C++ and there they use virtual inline…
You can't inline virtual methods, since you don't know which method will be suspect C++ simply ignores the directive in the case of a virtual method.
Michael.
2011/8/18 : At first I didn't understand how a virtual function can be inlined (in C++),…
Thanks all for the information. I will have a read to understand the backgrounds better.
Darius