Why are functions not virtual?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Why are functions not virtual?

intoxica
I am not very experienced C++ programmer so wanted to know; If the functions
in the pcl source codes would have been virtual it would help override some
of the functionality. Was wondering what is the reason they are not?
Thank you.



--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are functions not virtual?

Sérgio Agostinho
There is a small overhead that comes from declaring functions virtual,
therefore we only declare them virtual when we're sure we need to derive
classes from it.

Is there any particular method which you think it would benefit from
being declared virtual?

Cheers

On 29-11-2017 00:53, intoxica wrote:

> I am not very experienced C++ programmer so wanted to know; If the functions
> in the pcl source codes would have been virtual it would help override some
> of the functionality. Was wondering what is the reason they are not?
> Thank you.
>
>
>
> --
> Sent from: http://www.pcl-users.org/
> _______________________________________________
> [hidden email] / http://pointclouds.org
> http://pointclouds.org/mailman/listinfo/pcl-users

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users