Re: inheritance or include ?
If your "library" has only static methods, what does it mean to have an "instance" of that class?
As far as I know, just include your class, and use it.
You can publicly inherit from it if you want to expand the class to give it more methods, but when it comes down to using it, just include and call it.
Re: inheritance or include ?
Quote:
Originally Posted by sw21
I have a statics library (all methods are static, no data member)
You could consider turning it into a namespace of free functions instead.
Re: inheritance or include ?
Quote:
Originally Posted by
monarch_dodra
If your "library" has only static methods, what does it mean to have an "instance" of that class?
As far as I know, just include your class, and use it.
You can publicly inherit from it if you want to expand the class to give it more methods, but when it comes down to using it, just include and call it.
That is what I think as well. How to be sure it is better ? is there any book where this case is covered, with a typical excample ? it is for a professional use, I have to be sure of what I do.
Thank you anyway for your answers
Re: inheritance or include ?
Quote:
Originally Posted by
sw21
That is what I think as well. How to be sure it is better ? is there any book where this case is covered, with a typical excample ? it is for a professional use, I have to be sure of what I do.
Thank you anyway for your answers
"Static" or dynamic aside
If you don't include a header file then you won't be able to use it!
Anyone claiming that he can should be crackers.
Also, calling static methods crops up different issues
Re: inheritance or include ?
Nice explanation, but is it a free library ? You mind if I ask for sharing ?