17 Buffer-oriented streams [buffer.stream]

17.3 Class transfer_at_least [buffer.stream.transfer.at.least]

The class transfer_at_least is a completion condition that is used to specify that a read or write operation should continue until a minimum number of bytes has been transferred, or until an error occurs.

namespace std {
namespace experimental {
namespace net {
inline namespace v1 {

  class transfer_at_least
  {
  public:
    explicit transfer_at_least(size_t m);
    size_t operator()(const error_code& ec, size_t n) const;
  private:
    size_t minimum_; // exposition only
  };

} // inline namespace v1
} // namespace net
} // namespace experimental
} // namespace std

The class transfer_at_least satisfies the CompletionCondition ([buffer.stream.reqmts.completioncondition]) requirements.

explicit transfer_at_least(size_t m);

Postconditions: minimum_ == m.

size_t operator()(const error_code& ec, size_t n) const;

Returns: If !ec && n < minimum_, an unspecified non-zero value. Otherwise 0.