MCPcopy Create free account
hub / github.com/Tradias/asio-grpc / next

Method next

example/multi-threaded-client.cpp:44–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 RoundRobin(Iterator begin, std::size_t size) : begin_(begin), size_(size) {}
43
44 decltype(auto) next()
45 {
46 const auto cur = current_.fetch_add(1, std::memory_order_relaxed);
47 const auto pos = cur % size_;
48 return *std::next(begin_, static_cast<std::ptrdiff_t>(pos));
49 }
50
51 private:
52 Iterator begin_;

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected