Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static function leading to more static functions

Tags:

c++

I have a class that has a few functions that are useful on their own, which are static. Now these functions depend on other functions that are not useful on their own (but don't interact with class member variables) but are also static, so they are private. Now I have a class with many non-static functions, and couple of static public functions and a few static private functions.

Is this good practice? (should I be making this a community wiki?)

like image 478
Samaursa Avatar asked May 17 '11 14:05

Samaursa


1 Answers

I think you should declare those functions as free functions. If they do not need the members it should be not a big deal.
Maybe you should read this article. I found it very useful to improve my class designs.

like image 175
mkaes Avatar answered Oct 19 '22 22:10

mkaes