title: Why would you ever make a unique pointer to a primitive type in c++?
body: <p>I just found this code and who knows where or when it came from, but it's the end of a function and rather than returning a simple int64_t type, it makes a unique_ptr to it.</p>
  
  <p>I'm just wondering if anybody can explain where this usage has value?</p>
  
  <pre><code>return std::make_unique&lt;int64_t&gt;(off);
  </code></pre>
  
  <p>Update:</p>
  
  <p>It isn't being used this way, but as I commented below, one possible use of a pointer to primitive vs just the primitive is that you can set the pointer to null and thus add a flag to the integer as in error or not available.</p>