MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / decrement

Function decrement

3rd/asio-1.24.0/include/asio/buffers_iterator.hpp:377–404  ·  view source on GitHub ↗

Decrement the iterator.

Source from the content-addressed store, hash-verified

375
376 // Decrement the iterator.
377 void decrement()
378 {
379 ASIO_ASSERT(position_ > 0 && "iterator out of bounds");
380 --position_;
381
382 // Check if the decrement can be satisfied by the current buffer.
383 if (current_buffer_position_ != 0)
384 {
385 --current_buffer_position_;
386 return;
387 }
388
389 // Find the previous non-empty buffer.
390 buffer_sequence_iterator_type iter = current_;
391 while (iter != begin_)
392 {
393 --iter;
394 buffer_type buffer = *iter;
395 std::size_t buffer_size = buffer.size();
396 if (buffer_size > 0)
397 {
398 current_ = iter;
399 current_buffer_ = buffer;
400 current_buffer_position_ = buffer_size - 1;
401 return;
402 }
403 }
404 }
405
406 // Advance the iterator by the specified distance.
407 void advance(std::ptrdiff_t n)

Callers 1

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected