complete.h 523 B

123456789101112131415161718192021
  1. // This file is part of Desktop App Toolkit,
  2. // a set of libraries for developing nice desktop applications.
  3. //
  4. // For license and copyright information please follow this link:
  5. // https://github.com/desktop-app/legal/blob/master/LEGAL
  6. //
  7. #pragma once
  8. #include <rpl/producer.h>
  9. namespace rpl {
  10. template <typename Value = empty_value, typename Error = no_error>
  11. inline auto complete() {
  12. return make_producer<Value, Error>([](const auto &consumer) {
  13. consumer.put_done();
  14. return lifetime();
  15. });
  16. }
  17. } // namespace rpl