Why doesn't this code work???
ErrorCode:template<class t> t sum( t a, t b ) { return a + b; } template<class t> class c_x { public: t a, b, c; void sum() { c = sum( a, b ); } }; void main() { c_x<int> x; x.a = 10; x.b = 20; x.sum(); }
C2660: 'c_x<t>::sum' : function does not take 2 arguments
with
[
t=int
]




Reply With Quote