Guest User

Untitled

a guest
Jan 17th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. template<typename IteratorType>
  2. inline bool MyClass::readRawData(
  3. const IteratorType& first,
  4. const IteratorType& last,
  5. typename std::iterator_traits<IteratorType>::iterator_category* = nullptr
  6. )
  7. {
  8. _readStream.read(reinterpret_cast<char*>(&*first), (last-first)*sizeof(*first));
  9. return _readStream.good();
  10. }
  11.  
  12. assert(&*last - &*first == last - first &&
  13. "Iterators must represent a contiguous memory region");
  14.  
  15. typename std::iterator_traits<IteratorType>::iterator_category* = nullptr
  16.  
  17. template<typename T>
  18. bool readRawData(T* first, T* last);
Add Comment
Please, Sign In to add comment