<<< Templates | Index | Template syntax for classes >>> |
Stack< int > stack_i;
Stack< double > stack_d;
Stack< Stack < Rational > > stack_r; // be careful about spacing!
stack_i.push( 10 );
stack_d.push( 3.14 );
stack_d.push( stack_i.pop() );
Rational rat( 4, 5 );
stack_i.push( rat ); // type safety??
<<< Templates | Index | Template syntax for classes >>> |