From: David Wells Date: Thu, 1 Jun 2023 03:59:47 +0000 (-0400) Subject: Add a shim for std::clamp(). X-Git-Tag: v9.5.0-rc1~161^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64735c01f7e9f524ba1687ab34887605e9050127;p=dealii.git Add a shim for std::clamp(). --- 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