Skip to content
Snippets Groups Projects
Commit 6832746c authored by Oliver Sander's avatar Oliver Sander
Browse files

Revert patch 7032 (which moved Power_m_p to a separate file)

Good intentions, but not very elegantly done.  Too many people
got annoyed by the warning message.

[[Imported from SVN: r7036]]
parent 86854278
No related branches found
No related tags found
No related merge requests found
......@@ -20,8 +20,6 @@
#include <dune/common/deprecated.hh>
#include "exceptions.hh"
#include <dune/common/typetraits.hh>
#warning If you have included misc.hh only for the Power_m_p class please include power.hh instead.
#include <dune/common/power.hh>
namespace Dune {
......@@ -67,6 +65,22 @@ namespace Dune {
return t*t;
}
//! Calculates m^p at compile time
template <int m, int p>
struct Power_m_p
{
// power stores m^p
enum { power = (m * Power_m_p<m,p-1>::power ) };
};
//! end of recursion via specialization
template <int m>
struct Power_m_p< m , 0>
{
// m^0 = 1
enum { power = 1 };
};
//! Calculates the factorial of m at compile time
template <int m>
struct Factorial
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment