Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. template <typename T>
  2. void fillVector(std::vector<uint8_t>& dest, T t)
  3. {
  4. auto ptr = reinterpret_cast<uint8_t*>(&t);
  5. dest.insert(dest.end(),ptr,ptr+sizeof(t));
  6. }
  7.  
  8. fillVector<uint32_t>(dst,32bitdata);
  9. fillVector<uint16_t>(dst,16bitdata);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement