title: Storage duration of value assigned to pointer
body: <p>The following class is given:</p>
  
  <pre><code>class Button {
  
  public:
  
     enum Color{RED, GREEN, BLUE};
     Color color = RED;
  
     void setToBlue() {
        Color* colorPtr = &amp;color;
        *colorPtr = BLUE;
        //colorPtr-&gt;BLUE;
     }
  
  }
  </code></pre>
  
  <p>If I call <code>setToBlue()</code>, will <code>BLUE</code> not be destroyed until <code>Button</code> is destroyed? Why is the out commented instruction not valid?</p>