maybe.cpp 558 B

12345678910111213141516
  1. #include "maybe.h"
  2. #include <util/system/type_name.h>
  3. [[noreturn]] void NMaybe::TPolicyUndefinedExcept::OnEmpty(const std::type_info& valueTypeInfo) {
  4. ythrow yexception() << "TMaybe is empty, value type: "sv << TypeName(valueTypeInfo);
  5. }
  6. [[noreturn]] void NMaybe::TPolicyUndefinedFail::OnEmpty(const std::type_info& valueTypeInfo) {
  7. const TString typeName = TypeName(valueTypeInfo);
  8. Y_ABORT("TMaybe is empty, value type: %s", typeName.c_str());
  9. }
  10. template <>
  11. void Out<TNothing>(IOutputStream& o, const TNothing&) {
  12. o << "(empty maybe)";
  13. }