For some reason, I did not receive Verdi's message, only Nathan's, but
I then found it in the archives.
In any case, thanks for the responses.
The case where overloading is not preferable is performance.
In the overloading case:
inline int foo(std::vector<aaa> &x) {
std::vector<bbb> y; // empty vector
return foo(x, y);
}
The default empty vector, y must be instantiated each time the function
is called. In the non-overloading case:
const std::vector<bbb> zero(0);
The vector zero is only instantiated once at run-time.
In the code I am porting, some of the functions take a number of
arguments with some being default arguments. Since I am essentially
taking only part of the original code as the basis for a new product, I
can take considerable liberties by eliminating things that we don't
want. (The original code was written before the STL was standardized.
One of our design parameters is to use either the STL or RogueWave to
implement containers and strings rather than the original home-grown
classes. One reason for RogueWave is that its STL is threadsafe where
the Linux STL implementation is not).
--
Jerry Feldman