I'm trying to build a demo program, but the code for it is not properly compiling. Specifically, when I try to build it, it has a problem with the sort function, saying "Call to function 'sqrt' that is neither visible in the template definition nor found by argument-dependent lookup". What's also odd is there is one other instance of the sqrt function that is not causing an issue.

Here is the code that's causing an issue:

template <class T, unsigned int C>
T length(const vector_fixed<T,C> & a) {
return (T) sqrt(length2(a));

And here is the code that also includes sqrt but does not cause an issue:
T two_norm() const {
return sqrt(dot_product(*this));

Any help would be greatly appreciated. Thanks!