R
Ryan
I'm writing a templated class and would like to have a user definable
function to apply algorithmic modifiers. Something alone these lines:
typedef template <typename T> T (*ObjectModifier)(T);
template <typename T>
class Object
{
public:
SetModifier( ObjectModifier om );
ApplyModifier();
private:
T data;
};
The above doesn't actually work though, i.e. it won't compile. But I think
it does a pretty good job of showing the direction I want to go in...is
there a way to do this?
Thanks!
function to apply algorithmic modifiers. Something alone these lines:
typedef template <typename T> T (*ObjectModifier)(T);
template <typename T>
class Object
{
public:
SetModifier( ObjectModifier om );
ApplyModifier();
private:
T data;
};
The above doesn't actually work though, i.e. it won't compile. But I think
it does a pretty good job of showing the direction I want to go in...is
there a way to do this?
Thanks!