From 84ed32a793793c879ccd1f7ace523b7246fa1561 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 5 Mar 2022 22:46:50 -0700 Subject: [PATCH] Add std_cxx17::variant. --- include/deal.II/base/std_cxx17/variant.h | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/deal.II/base/std_cxx17/variant.h diff --git a/include/deal.II/base/std_cxx17/variant.h b/include/deal.II/base/std_cxx17/variant.h new file mode 100644 index 0000000000..f7f3ec2792 --- /dev/null +++ b/include/deal.II/base/std_cxx17/variant.h @@ -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 + +#ifdef DEAL_II_HAVE_CXX17 +# include +#else +DEAL_II_DISABLE_EXTRA_DIAGNOSTICS +# include +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 -- 2.39.5