fork(10) download
  1. #include <stack>
  2. #include <iostream>
  3.  
  4. class my_stack : public std::stack< char > {
  5. public:
  6. using std::stack<char>::c; // expose the container
  7. };
  8.  
  9. int main() {
  10. my_stack blah;
  11. blah.push( 'a' );
  12. blah.push( 'b' );
  13. std::cout << blah.c[ 1 ];
  14.  
  15. }
  16.  
Success #stdin #stdout 0.02s 2816KB
stdin
Standard input is empty
stdout
b