Static inline methods?

c++, inline, static

Solution

If you are calling bar from another cpp file, other than foo.cpp, it needs to be in a header file.

Problem

Okay, Here is what I'm trying to do... Right now it is compiling but failing at linking... LNK2001 I want the methods static because there are no member variables, however I also want them inline for the speedups they provide. What is the best way to do this? Here is what I have in a nutshell: ``` /* foo.h */ class foo { static void bar(float* in); }; /* foo.cpp */ inline void foo::bar(float* in) { // some dark magic here } ``` I'm trying to do this because I want to be able to go: ``` foo::bar(myFloatPtr); ``` foo doesn't have any member variables... it doesn't make sense to.

Original source

Related problems