never.h 497 B

1234567891011121314151617181920
  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 never() {
  12. return make_producer<Value, Error>([](const auto &consumer) {
  13. return lifetime();
  14. });
  15. }
  16. } // namespace rpl