title: (C++) unable to call push() and pop() from my stack object
body: <p>Why am I unable to use the push() and pop() function calls of my stack? Here are the errors:</p>
  
  <pre><code>HCTree.cpp:65:16: error: no matching member function for call to 'push'
    encoding.push(0);
    ~~~~~~~~~^~~~
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack:197:10: note: 
    candidate function not viable: 'this' argument has type 'const stack&lt;int,
    std::vector&lt;int&gt; &gt;', but method is not marked const
  void push(value_type&amp;&amp; __v) {c.push_back(_VSTD::move(__v));}
       ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack:194:10: note: 
    candidate function not viable: 'this' argument has type 'const stack&lt;int,
    std::vector&lt;int&gt; &gt;', but method is not marked const
  void push(const value_type&amp; __v) {c.push_back(__v);}
       ^
  HCTree.cpp:67:16: error: no matching member function for call to 'push'
    encoding.push(1);
    ~~~~~~~~~^~~~
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack:197:10: note: 
    candidate function not viable: 'this' argument has type 'const stack&lt;int,
    std::vector&lt;int&gt; &gt;', but method is not marked const
  void push(value_type&amp;&amp; __v) {c.push_back(_VSTD::move(__v));}
       ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack:194:10: note: 
    candidate function not viable: 'this' argument has type 'const stack&lt;int,
    std::vector&lt;int&gt; &gt;', but method is not marked const
  void push(const value_type&amp; __v) {c.push_back(__v);}
       ^
  HCTree.cpp:73:16: error: member function 'pop' not viable: 'this' argument has type 'const
    stack&lt;int, std::vector&lt;int&gt; &gt;', but function is not marked const
    out.writeBit(encoding.pop());
             ^~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack:206:10: note: 
    'pop' declared here
  void pop() {c.pop_back();}
       ^
  </code></pre>
  
  <p>the code:</p>
  
  <pre><code>void HCTree::encode(byte symbol, BitOutputStream&amp; out) const
  {
  
    HCNode* temp;
    temp = leaves[symbol];//store leaf node containing symbol into temp
    /* traverse to the top of the tree */
    while(temp-&gt;p != NULL)
    {
      /* record path we take to parent into a stack */
      if(temp == temp-&gt;p-&gt;c0)//if temp is the c0 child
        encoding.push(0);
      else//temp is the c1 child
        encoding.push(1);
  
      temp = temp-&gt;p;//move up to temp's parent and repeat
    }
  
     /* write bits to buffer */
     out.writeBit(encoding.pop());
  
  
  }
  </code></pre>
  
  <p>Relevant line from HCTree.hpp:</p>
  
  <pre><code>    stack&lt;int,std::vector&lt;int&gt;&gt; encoding;
  </code></pre>
  
  <p>Is there something about using a vector that is preventing me from using the push() and pop() function calls?</p>