title: pop_back() not working
body: <p>I have the following main program that creates a <code>Stack</code> object, fills it with doubles and then pops them. The code files fine, but the <code>pop_back()</code> part does not seem to work, while <code>s.back()</code> does return the correct value. How is this possible?</p>
  
  <pre><code>#include "Stack.h"
  #include &lt;iostream&gt;
  #include &lt;deque&gt;
  using namespace std;
  int main() {
  
    Stack&lt;double&gt; s(0,0.0);
  
    // Write doubles into Stack
    int i ;
    for (i=0 ; i&lt;15 ; i++) {
  
      s.push(i*i) ;
  
    }
  
  
    // Read doubles back from fifo
    while (!s.empty()) {
      double val = s.pop() ;
      std::cout &lt;&lt; "Popping value " &lt;&lt; val &lt;&lt; " from stack" &lt;&lt; std::endl ;
  
    }
  
    return 0 ;
  
  }
  </code></pre>
  
  <p>My header file looks like this, where I have omitted parts which are not relevant to the question. </p>
  
  <pre><code>#ifndef STACK_H
  #define STACK_H
  
  #include &lt;iostream&gt;
  #include &lt;deque&gt;  
  
  template&lt;class T&gt;
  class Stack {
  
  public:  
  
    Stack(int len, T defval): s(len+1, defval) {
  
      return;
  }
  
  ~Stack() {
  
      //delete [] s;
  }
  
  void push(T c) {
  
      s.push_back(c);
  
  }
  
  T pop() {
  
      return s.back();
      s.pop_back();  
  
  }
  
  private:   
  
    std::deque&lt;T&gt; s; //Array&lt;T&gt; s;  
  
  };
  
  #endif
  </code></pre>