On Wed, 2004-01-14 at 14:04, Stefan Olsson wrote:
void:~/nstl$ /home/admin/gcc/bin/g++ balloc_test.cpp -I ./ -O3
In file included from ./nstl/algorithm.hpp:29,
from nstl/balloc.hpp:35,
from balloc_test.cpp:1:
./nstl/detail/nstl_algorithm.hpp: In member function `c
nstd::_quick_sort<t>::_aux_unstable_partition(c, c)':
./nstl/detail/nstl_algorithm.hpp:227: error: expected `;' before "__pivot"
./nstl/detail/nstl_algorithm.hpp:231: error: `__pivot' undeclared (first
use this function)
./nstl/detail/nstl_algorithm.hpp:231: error: (Each undeclared identifier
is reported only once for each function it appears in.)
The line in question is:
std::iterator_traits<c>::value_type __pivot = (*__first+*__last)/2;
The thing is that I've unknowingly used used some reserved names. The
possible causes for this would be:
1. Use of reserved names.
2. Assuming that *__first and *__last can be added, and then assuming
that the result can be divided by 2. Lots of stupid assumptions for
testing!
However, I have not used the code under question anywhere, so I guess
g++ should not even instantiate it. So, g++ trying to instantiate it for
types that don't suppport addition and division is out of the question.
I'm attaching a newer version of the file, so replace it and try again.