title: Shared pointer from get() inside block
body: <p>I am having some confusion with the following code snippet</p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;memory&gt;
  
      using namespace std;
  
      int main()
      {
  
          int *iptr = new int(12); //create built-in pointer
  
          shared_ptr&lt;int&gt; s(iptr); //create shared pointer to it
  
          int *q = s.get();        //get built-in back using get (redundant step, but I was practicing)
  
          shared_ptr&lt;int&gt; (q); //Does NOT work without giving it a separate block ; error: conflicting declaration ‘std::shared_ptr q’ 
  
          //{shared_ptr&lt;int&gt; (q);} //This works!!
  
          return 0;
      }
  </code></pre>
  
  <p>My question is why one works while the other does not? What name does the one in the scoped block get? it seems to have no name if we follow the following syntax [<code>type name(args)</code>]</p>