I am Trying to learn the design rationale for some project,I am trying to run a code given as examples. Here i try to recursively calculate the distance between two points in n dimensions, I can achieve the objective of this code through many other means but i just want to understand this case specifically.(I want to learn Syntax) 

Here is my code

```
 template <typename P1, typename P2, int D>
 struct pythagoras
 {
    typedef typename select_most_precise
    <
        typename coordinate_type<P1>::type,
        typename coordinate_type<P2>::type
    >::type computation_type;

    static  double apply(P1 & a, P2 & b)
    {
       double d = get<D-1>(a) - get<D-1>(b);
       return d * d + pythagoras<P1, P2, D-1>::apply(a, b);
    }
};

int main ()
{
   tuple<int,int> mytuple (10,20),two (10,20);
   int f=2;
   double h=pythagoras<tuple<int,int>,tuple<int,int>,int>::apply(mytuple,two,f);
   cout << h;
}

```

Questions:   

1- I am Getting the Error **expected a constant of type ‘int’, got ‘int’**
,How do i resolve it?

2- What does the error actually mean?

3- The code "Typedef" to "computation\_type" this is used to get the type of the variables, How does this work?