Skip to content
Snippets Groups Projects
Commit f39892c5 authored by Christian Engwer's avatar Christian Engwer
Browse files

[math] deduce the return value of Power in order to allow unit value types (see dune-grid#79)

parent 0dab1b25
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ namespace Dune {
struct Power
{
template <typename T>
static constexpr T eval(const T & a)
static constexpr auto eval(const T & a)
{
return PowerImp<p>::eval(a);
}
......@@ -57,7 +57,7 @@ namespace Dune {
struct PowerImp<p,false>
{
template <typename T>
static constexpr T eval(const T & a)
static constexpr auto eval(const T & a)
{
T t = Power<p/2>::eval(a);
return t*t;
......@@ -68,7 +68,7 @@ namespace Dune {
struct PowerImp<p,true>
{
template <typename T>
static constexpr T eval(const T & a)
static constexpr auto eval(const T & a)
{
return a*Power<p-1>::eval(a);;
}
......@@ -78,7 +78,7 @@ namespace Dune {
struct PowerImp<1,true>
{
template <typename T>
static constexpr T eval(const T & a)
static constexpr auto eval(const T & a)
{
return a;
}
......
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