Note that because you're accessing the function via a function pointer (which is a call you can't inline), you will likely kill any speed benifit you gained from using shifts instead of a generic multiplication in the first place.
Also note that you're probably prematurely optimizing, which is a BAD THING (tm). Code this optimized does not really belong in a userspace program. In drivers, yes.
All that said:
For the purpouses of explaining the syntax of C++, and how to make this example work (even if it's a bad idea to implement):
I'd suggest making the shift* functions static (prefered here, since it dosn't need to access any of the member functions). Example:
static unsigned int shift640( unsigned int y ) { return (y<<9) + (y<<7); }
(Note the lack of the inline keyword - it makes no sense in this context, since you're using a function pointer.)
Member functions of C++ classes are special, in that they work with an instance of the class - in other words they need a this pointer, which is used implicitly whenever you accesses a member of the class (other functions that use the this pointer, or directly through any non-static variables).
The use of the "static" keyword for a member function means you can't use the this pointer, or any non-static variables.
The use of the "static" keyword for a member variable means there's only one instance of that variable for the entire type. You'll also have to provide an instansiation of that variable in one of your compile units.
In cases where a "this" pointer is needed for the function to work, you need a different syntax. Example:
class MyClass{ int my_number;public: MyClass( int my_number ) : my_number(my_number) { } void print_number( void ) { cout << "My number: " << my_number << endl; } void print_5_times_number( void ) { cout << "My number times 5: " << (my_number * 5) << endl; }};void (MyClass::*function)( void ); //Declares the pointerfunction = MyClass::print_number; //Sets the function calledMyClass my_class_5 ( 5);MyClass my_class_10 (10);my_class_5.*function(); //Prints 5my_class_10.*function(); //Prints 10function = MyClass::print_5_times_number;my_class_5.*function(); //Prints 25my_class_10.*function(); //Prints 50