From f2bcbfa733dfce9d2e4a691ff8f9df98bdb83caf Mon Sep 17 00:00:00 2001 From: Yuriy Skalko Date: Fri, 13 Nov 2020 00:48:11 +0200 Subject: [PATCH] Support `optional` type --- src/support/Makefile.am | 1 + src/support/optional.h | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/support/optional.h diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 785b97f395..0933b02c77 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -87,6 +87,7 @@ liblyxsupport_a_SOURCES = \ Messages.cpp \ Messages.h \ numpunct_lyx_char_type.h \ + optional.h \ os.cpp \ os.h \ PathChanger.cpp \ diff --git a/src/support/optional.h b/src/support/optional.h new file mode 100644 index 0000000000..4d860a7cf8 --- /dev/null +++ b/src/support/optional.h @@ -0,0 +1,23 @@ +// -*- C++ -*- +/** + * \file optional.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Yuriy Skalko + * + * Full author contact details are available in file CREDITS. + */ + +#ifndef LYX_OPTIONAL_H +#define LYX_OPTIONAL_H + +#if __cplusplus >= 201703L + #include + namespace lyx { using std::optional; } +#else + #include + namespace lyx { using boost::optional; } +#endif + +#endif // LYX_OPTIONAL_H -- 2.39.5