title: What is the liftime of a literal of any type if we hold the reference of it or are passsing it to a function by rvalue reference?
body: <p>I have the following code:</p>
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
      
  void func1(int &amp;&amp;val) {
      
      // statements
      
  }
      
  int main() {
      
      const int &amp;i = 5; //line1
      
      func1(4);// line 2
      
      return 0;
  }
  </code></pre>
  <p>Is the lifetime of i in line 1 same as the lifetime or scope of main()? What about the liftime of the integer literal 4 in line 2, is its lifetime also same as that of main()?</p>