I would like to use GSL within a c++ class without declaring member functions as static
. The reason for this is because I don\'t know them too well and I\'m not
Sorry, but what you're trying to do doesn't make any sense. Whatever thread safety issues you're worried about, they won't be solved by adding or removing the static
keyword.
The only reason why you would make g
non-static would be if an instance of A
was somehow required for g
's operation. And g's current implementation doesn't require such an instance.
Note you can also make g
a global function, without the static
keyword. There would be no visible difference in your case. However it's better style in your case to have g
in the class which makes use of it, as a static function.
Also, Here is some related material about pointers to (static/non-static) member functions.