| 363 | |
| 364 | template <class Derived, class Container> |
| 365 | inline |
| 366 | void |
| 367 | DynamicStruct<Derived, Container, Mutable>::resize() { |
| 368 | size_t begin = this->begin(); |
| 369 | ByteStream_type& stream = this->byteStream(); |
| 370 | stream.seek(begin, std::ios_base::beg); |
| 371 | |
| 372 | // We use an RAII object here that ensure that dry mode will also be |
| 373 | // left in case of exceptions |
| 374 | typename ByteStream_type::DryRun dryRun(stream); |
| 375 | stream >> static_cast<Derived&>(*this); |
| 376 | dryRun.leave(); |
| 377 | |
| 378 | stream.template seek<ByteStream_type::maximumAlignment>(0, |
| 379 | std::ios_base::cur); |
| 380 | size_t newEnd = stream.tell(); |
| 381 | this->setSize(newEnd - begin); |
| 382 | } |
| 383 | |
| 384 | template <class Derived, class Container> |
| 385 | template <class OtherDerived> |
no test coverage detected