From: Wolfgang Bangerth Date: Sun, 6 Mar 2022 05:46:50 +0000 (-0700) Subject: Add std_cxx17::variant. X-Git-Tag: v9.4.0-rc1~405^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84ed32a793793c879ccd1f7ace523b7246fa1561;p=dealii.git Add std_cxx17::variant. --- 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