Topic: Question about times (and template) ?


Author: abed@ritz.cec.wustl.edu (Abed Hammond)
Date: 1995/07/11
Raw View
Hello,  I just upgraded to g++ 2.7.0. I noticed that the name times
is used for a structure name in addition to minus, plus, ...etc

This breaks my code because I have been using the POSIX function
times() for timing my code. So is the times struct part of the
c++ standard. I looked up the working paper and Indeed it was.

So whats the solution...I keep getting the error times() multiply
defined !!

In addition, could some one please tell me if I can overload a
template function as foloow:

template <class T>
T norm(Vector<T> const &A,  int n = 2) {

}

and

template <class T>
T norm(Vector< complex<T> > const &A,  int n = 2) {

}

g++ 2.7.0 is giving problems (umbigues template instantiation is
requested). What does the language say about this.

Thanks for the help,
Abed

============================================================================
Abed M. Hammoud, D.Sc.                          a.hammoud@ieee.org

Surgical Navigation Technologies       -Voice: (314) 863-0817
Colorado, USA          -Fax:   (314) 935-4842
============================================================================