octave has template functions that call abs() on templated variables, something like:

template <class T>
T myfunc(T arg) {
T x = abs(arg);
}


This leads to errors when instantiated for unsigned types because abs(unsigned type) is not defined as is doesn't make sense to do. That's fine and all, but how then does one write generic template code as above that works for signed and unsigned types.

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  or...@cora.nwra.com
Boulder, CO 80301              http://www.cora.nwra.com
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org

Reply via email to