Mail Archives: djgpp/2002/09/18/10:29:21
Kim Seng <Query AT singnet DOT com DOT sg> wrote:
> program13.cc:14: use of `count' is ambiguous
> program13.cc:7: first declared as `int count' here
> c:/djgpp/lang/cxx-v3/bits/stl_algo.h:320: also declared as `typename
> std::iterator_traits<_Iterator>::difference_type std::count(_InputIter,
> _InputIter, const _Tp&)' here
I haven't even seen your code (don't UUencode source code, please...),
but IMHO the error message is quite self-explanatory even so. Your
program contains an error. It uses two things that conflict with each
other:
1) a variable declared
int count;
2) the statement
using std;
There obviously is an object 'std::count' in the STL headers. The
'using std' pulls that into your program's namespace, where it
collides with your variable named the same.
Solution: rename your variable, or get rid of that "using std".
Better solution: get a an up-to-date C++ textbook that works with the
final standardized language, not some outdated predecessor of it.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -