Timeline for Is it possible that function will get a parameter that can be int OR char?
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 1, 2019 at 6:52 | comment | added | guyd | Yes I know... this is the closest I could find | |
May 1, 2019 at 6:51 | comment | added | Juraj♦ | you want a class with a template function, not a template class stackoverflow.com/questions/972152/… | |
May 1, 2019 at 5:55 | comment | added | guyd | see EDIT2 in my Q | |
May 1, 2019 at 5:55 | comment | added | guyd | I try to follow example 2 in : programiz.com/cpp-programming/templates | |
May 1, 2019 at 3:57 | comment | added | Juraj♦ |
why did you use <class T>? it should be template <typename T>
|
|
Apr 30, 2019 at 18:54 | comment | added | guyd | pasted .h file inside my Q | |
Apr 30, 2019 at 18:52 | review | Suggested edits | |||
Apr 30, 2019 at 20:03 | |||||
Apr 30, 2019 at 7:23 | comment | added | Juraj♦ | add the code of the class to the Question. is it a class with separate .h and .cpp files? do you have the template<> part of function declaration in .h too? | |
Apr 30, 2019 at 5:42 | comment | added | guyd | a method that uses template inside a class | |
Apr 30, 2019 at 4:54 | comment | added | Juraj♦ | by "put it inside a library", you mean using it as class's method? | |
Apr 29, 2019 at 20:22 | comment | added | guyd |
When trying to take such function and put it inside a library ( using template as noted here ), i get an error. how can it be done?
|
|
Apr 28, 2019 at 17:10 | vote | accept | guyd | ||
Apr 27, 2019 at 3:54 | history | edited | Juraj♦ | CC BY-SA 4.0 |
added 16 characters in body
|
Apr 27, 2019 at 3:47 | history | answered | Juraj♦ | CC BY-SA 4.0 |