+ 2

C++ void template?

i just learn c++ template. and i do some experiment with it. and i finally i facing a problem. take a look this code: #include <iostream> //using namespace std; //bad idea template <class A, class B> class kevin { public: void fung1(A a, B b); }; template <class A, class B> void kevin<void>::fung1(A a, B b);//error, how to do that? //what i know, <void> is data type that will returned int main(){} little confusing

16th Jan 2018, 11:07 AM
Kevin AS
Kevin AS - avatar
1 Odpowiedź
+ 5
Hello I have looked at your code, it should work know (toke me some time) https://code.sololearn.com/c1dT9VxEwJxk
16th Jan 2018, 4:17 PM
Thor Westergren
Thor Westergren - avatar