From 64735c01f7e9f524ba1687ab34887605e9050127 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 31 May 2023 23:59:47 -0400 Subject: [PATCH] Add a shim for std::clamp(). --- include/deal.II/base/std_cxx17/algorithm.h | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 include/deal.II/base/std_cxx17/algorithm.h diff --git a/include/deal.II/base/std_cxx17/algorithm.h b/include/deal.II/base/std_cxx17/algorithm.h new file mode 100644 index 0000000000..f4318a9a63 --- /dev/null +++ b/include/deal.II/base/std_cxx17/algorithm.h @@ -0,0 +1,37 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2023 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_algorithm_h +#define dealii_cxx17_algorithm_h + +#include + +#ifdef DEAL_II_HAVE_CXX17 +# include +#else +# include +#endif + +DEAL_II_NAMESPACE_OPEN +namespace std_cxx17 +{ +#ifndef DEAL_II_HAVE_CXX17 + using boost::algorithm::clamp; +#else + using std::clamp; +#endif +} // namespace std_cxx17 +DEAL_II_NAMESPACE_CLOSE + +#endif // dealii_cxx17_variant_h -- 2.39.5