Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if 0
- assert(
- static_cast<std::size_t>((std::numeric_limits<std::streamsize>::max)()) >= count
- );
- //if(is.fail())
- // boost::throw_exception(archive_exception(archive_exception::stream_error));
- // note: an optimizer should eliminate the following for char files
- std::size_t s = count / sizeof(BOOST_DEDUCED_TYPENAME IStream::char_type);
- is.read(
- static_cast<BOOST_DEDUCED_TYPENAME IStream::char_type *>(address),
- s
- );
- // note: an optimizer should eliminate the following for char files
- s = count % sizeof(BOOST_DEDUCED_TYPENAME IStream::char_type);
- if(0 < s){
- if(is.fail())
- boost::throw_exception(archive_exception(archive_exception::stream_error));
- BOOST_DEDUCED_TYPENAME IStream::char_type t;
- is.read(& t, 1);
- std::memcpy(address, &t, s);
- }
- #endif
- // note: an optimizer should eliminate the following for char files
- std::streamsize s = count / sizeof(Elem);
- std::streamsize scount = m_sb.sgetn(
- static_cast<Elem *>(address),
- s
- );
- if(count != static_cast<std::size_t>(s))
- boost::throw_exception(
- archive_exception(archive_exception::stream_error)
- );
- // note: an optimizer should eliminate the following for char files
- s = count % sizeof(Elem);
- if(0 < s){
- // if(is.fail())
- // boost::throw_exception(archive_exception(archive_exception::stream_error));
- Elem t;
- scount = m_sb.sgetn(& t, 1);
- if(count != 1)
- boost::throw_exception(
- archive_exception(archive_exception::stream_error)
- );
- std::memcpy(address, &t, s);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement