top of page

Profile

Join date: 18 მაი. 2022

About

0 likes received
0 comments received
0 best answers

templated class foo that looks like this: class foo{ public: template void bar(arg x); }; I have another class bar which looks like



 

Nddn W58 Map Disk 206


Download


 





14 14 . ¿.E(M5D-DJJ)(EEI6-#)1:2*>E9-:88:>T9#@+J$>..?.=R:IPR>SBMF+NG2N&3F:J7T$@N=5JQ: Operator overloading for a templated class I have a templated class foo that looks like this: class foo{ public: template void bar(arg x); }; I have another class bar which looks like this: class bar{ public: template void bar(foo* f, arg x); }; Now, I want to overload the bar method of foo so that it can be used to call the foo::bar method with any type of arg. Here is my attempt: #include template class foo{ public: template void bar(arg x); }; class bar{ public: template void bar(foo* f, arg x); }; template void foo::bar(arg x){ std::cout a; bar b; a.bar(10); b.bar(a, 10); return 0; } Unfortunately, I get an error that says "no member named bar" on b.bar. I would like to have a single method that can handle any type of arg. How can I do




ee43de4aa9

Nddn W58 Map Disk 206 HOT!

More actions
bottom of page