]> git.lyx.org Git - features.git/commitdiff
Support `optional` type
authorYuriy Skalko <yuriy.skalko@gmail.com>
Thu, 12 Nov 2020 22:48:11 +0000 (00:48 +0200)
committerYuriy Skalko <yuriy.skalko@gmail.com>
Thu, 12 Nov 2020 22:48:24 +0000 (00:48 +0200)
src/support/Makefile.am
src/support/optional.h [new file with mode: 0644]

index 785b97f395bff73e9a6f7f05066fd665f7fa070b..0933b02c779fff2ac1136e2fb73ac2ed1039dc61 100644 (file)
@@ -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 (file)
index 0000000..4d860a7
--- /dev/null
@@ -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 <optional>
+       namespace lyx { using std::optional; }
+#else
+       #include <boost/optional.hpp>
+       namespace lyx { using boost::optional; }
+#endif
+
+#endif // LYX_OPTIONAL_H