utils: add Result / Option types

Add some Rust-style Result/Option types, based on TartanLlama's
expected, optional classes.

There's std::optional of course, but we can't depend on C++17 yet.
This commit is contained in:
Dirk-Jan C. Binnema
2020-11-09 09:20:54 +02:00
parent 13118ae173
commit 702a1d8452
6 changed files with 4465 additions and 6 deletions

View File

@ -45,17 +45,24 @@ AM_LDFLAGS= \
noinst_LTLIBRARIES= \
libmu-utils.la
third_party= \
optional.hpp \
expected.hpp
libmu_utils_la_SOURCES= \
mu-async-queue.hh \
mu-command-parser.cc \
mu-command-parser.hh \
mu-date.c \
mu-date.h \
mu-error.hh \
mu-logger.cc \
mu-logger.hh \
mu-command-parser.cc \
mu-command-parser.hh \
mu-option.hh \
mu-readline.cc \
mu-readline.hh \
mu-result.hh \
mu-sexp.cc \
mu-sexp.hh \
mu-str.c \
@ -63,7 +70,8 @@ libmu_utils_la_SOURCES= \
mu-util.c \
mu-util.h \
mu-utils.cc \
mu-utils.hh
mu-utils.hh \
${third_party}
libmu_utils_la_LIBADD= \
$(GLIB_LIBS) \