title: serialize int to vector of bytes using std::vector::reverse_iterator?
body: <p>Next function works fine:</p>
  
  <pre><code>std::vector&lt;uint8_t&gt; serialize_bytes(uint32_t ui)
  {
      return {(uint8_t*)&amp;ui, (uint8_t*)(&amp;ui+1)};
  }
  </code></pre>
  
  <p>But its result depends on endianess of machine.  </p>
  
  <p>I also need to serialize bytes in reverse order:</p>
  
  <pre><code>std::vector&lt;uint8_t&gt; serialize_bytes(uint32_t ui)
  {
      std::vector&lt;uint8_t&gt;::reverse_iterator 
          begin{(uint8_t*)(&amp;ui+1)-1}
        , end{(uint8_t*)(&amp;ui)-1};  //ERROR: Calling a private constructor
      return {begin, end};
  }
  </code></pre>
  
  <p>I know multiple other ways to do serialization. The interest of this Q is to construct reverse_iterator from pointer in manner like first snippet does.</p>