cplusplus.com cplusplus.com
cplusplus.com   C++ : Forums : General C++ Programming : Should too many virtual functions raise ... : Page 2
  Search:
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forums
Forums
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programm...
Articles
Lounge
Jobs

-

post  Should too many virtual functions raise a red flag?

satm2008 (149)
@ropez:
>>suppose they are more complex, each function may have a different set of subclasses that it handles, and there may be more than two levels in the class hierarchy.


I would not design a program as such in which it would have to handle hundreds of function check through a virtualy common function from their base class.
The design would be different in such case when there are hundreds of functions, as OO concept is to divide a big module into small objects and work on :)
|
jsmith (958)
BTW, I suspect many compilers have limitations on the number of virtual functions a single class can have. This is due to the way compilers handle pointer-to-virtual-member-functions. Without having actually looked at the GCC source, I'd bet that it has a limitation of 65,535 virtual functions. [This is because GCC would have no way to store a pointer to the 65,536th or beyond virtual member function].
|
ropez (312)
For those that are interested: There's a new discussion related to this topic here:
http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/c16097aad186f98d#
|

Pages: 1 2


This topic is archived - New replies not allowed.
Home page | Privacy policy
© cplusplus.com, 2000-2009 - All rights reserved - v2.2
Spotted an error? contact us