It comes from C, but isn't correct in C++. You should use:
1 2 3
class X
{
};
sqrt seems to be overloaded for long double, double and float, not for int. So you need to convert your int coordinates to one of these floating point types.
In instantiation of `std::iterator_traits<X>':
instantiated from here
no type named `iterator_category' in `class X'
no type named `value_type' in `class X'
no type named `difference_type' in `class X'
no type named `pointer' in `class X'
no type named `reference' in `class X'