|
-
November 5th, 2010, 09:21 AM
#3
Re: static functions
 Originally Posted by joebar
So what is wrong here?
You don't need to specify the static keyword before the function definition, only before the declaration in the header file.
Apart from the bug itself here, is that the right way to achieve what I want to achieve?
I don't know what you want to achieve. However, what you have here is nothing but a glorified global variable. There is little use for a class with only static members (unless the class is designed to be used as a template argument, e.g. in policy based design). Instead you can use a namespace to prevent polluting the global namespace. But then still, you are using a global variable, which is often a sign of bad design.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|