Skip to content
Snippets Groups Projects
Commit 365ca384 authored by Timo Koch's avatar Timo Koch
Browse files

[cleanup] Deprecate lcm and advertise C++17 STL solution

parent 0c54202b
No related branches found
No related tags found
1 merge request!825[cleanup] Deprecate gcd/lcm, advertise C++17 STL solution
......@@ -3,11 +3,13 @@
#ifndef DUNE_LCM_HH
#define DUNE_LCM_HH
#warning "This header is deprecated and will be removed after release 2.8. Use std::lcm instead."
/** \file
* \brief Statically compute the least common multiple of two integers
*/
#include <dune/common/gcd.hh>
#include <numeric>
namespace Dune
{
......@@ -26,7 +28,7 @@ namespace Dune
* @brief Calculate the least common multiple of two numbers
*/
template<long m, long n>
struct Lcm
struct [[deprecated("Will be removed after Dune 2.8. Use std::lcm instead.")]] Lcm
{
static void conceptCheck()
{
......@@ -37,7 +39,7 @@ namespace Dune
* @brief The least common multiple of the template parameters
* m and n.
*/
const static long value = (m/Gcd<m,n>::value)*n;
constexpr static long value = std::lcm(m,n);
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment