Hello ladies and gentlemen !
Is it the case that typedef is static and we can´t use it with templates or am I using the wrong syntax here ?
There is no problem when i using pre defined datatypes like this:
The problem arises when I try to use the function pointer together with the template like this:
now i get compiler error: cannot cast function. If this cannot be done, what would be the best minimalistic solution to the same problem? Would it be reasonable to create minimalistic classes for every function and then pass whole necessary classes using a pointer ? ...or what would be the best lightweight solution here ?
OK. i found myself solution already. This seems legit approach. Just please confirm when you have time that there is no easier and we can´t do that without classes... ?
class Func {}; typedef bool(*FPointer)(Func &foo);

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello ladies and gentlemen !
Is it the case that typedef is static and we can´t use it with templates or am I using the wrong syntax here ?
There is no problem when i using pre defined datatypes like this:
The problem arises when I try to use the function pointer together with the template like this:
now i get compiler error: cannot cast function. If this cannot be done, what would be the best minimalistic solution to the same problem? Would it be reasonable to create minimalistic classes for every function and then pass whole necessary classes using a pointer ? ...or what would be the best lightweight solution here ?