1 template<typename T>
abs(T x)2 T abs(T x) {
3   if (x < 0) {
4     return -x;
5   }
6   return x;
7 }
8