]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add std_cxx17::variant.
authorWolfgang Bangerth <bangerth@colostate.edu>
Sun, 6 Mar 2022 05:46:50 +0000 (22:46 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Sun, 6 Mar 2022 06:07:15 +0000 (23:07 -0700)
include/deal.II/base/std_cxx17/variant.h [new file with mode: 0644]

diff --git a/include/deal.II/base/std_cxx17/variant.h b/include/deal.II/base/std_cxx17/variant.h
new file mode 100644 (file)
index 0000000..f7f3ec2
--- /dev/null
@@ -0,0 +1,41 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2022 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+#ifndef dealii_cxx17_variant_h
+#define dealii_cxx17_variant_h
+
+#include <deal.II/base/config.h>
+
+#ifdef DEAL_II_HAVE_CXX17
+#  include <variant>
+#else
+DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
+#  include <boost/variant.hpp>
+DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
+#endif
+
+DEAL_II_NAMESPACE_OPEN
+namespace std_cxx17
+{
+#ifndef DEAL_II_HAVE_CXX17
+  using boost::get;
+  using boost::variant;
+#else
+  using std::get;
+  using std::variant;
+#endif
+} // namespace std_cxx17
+DEAL_II_NAMESPACE_CLOSE
+
+#endif // dealii_cxx17_variant_h

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.