+ 3

Pure Virtual Template Method

Pure virtual templates are not allowed in c++. In the code I posted is a base class for general math behaviors which should contain basic pure virtual methods which then get inheritanced into different specific classes (atm there is just a binary one, but just imagine there is another numberbase ^^) How can I make templates for the arguments? The different return types will be solved with a member variable and a get method. https://code.sololearn.com/cJn1BLdV9s4T/?ref=app

11th Feb 2018, 7:04 PM
Alex
Alex - avatar
1 Odpowiedź
0
template as argument example: template <int A> void fung() { std::cout << A; } int main(){fung<10>();}
25th Feb 2018, 1:47 AM
Kevin AS
Kevin AS - avatar