Am Donnerstag, 15. Juni 2006 00:17 schrieb Giuseppe Ragusa: > g++ -DHAVE_CONFIG_H -I. -I. -I../../src -Winvalid-pch --include=./pch.h > -I./.. -I../../boost -Wextra -Wall -fno-exceptions -g -O -MT > math_mathmlstream.lo -MD -MP -MF .deps/math_mathmlstream.Tpo -c > math_mathmlstream.C -o math_mathmlstream.o > ../../src/support/lyxalgo.h: In function 'typename > std::iterator_traits<_Iterator>::difference_type lyx::count(Iterator, > Iterator, const T&)': > ../../src/support/lyxalgo.h:84: error: expected `;' before 'n' > ../../src/support/lyxalgo.h:86: error: 'n' was not declared in this scope > ../../src/support/lyxalgo.h:87: error: 'n' was not declared in this scope > ../../src/support/lyxalgo.h: In function 'typename > std::iterator_traits<_Iterator>::difference_type lyx::count(Iterator, > Iterator, const T&) [with Iterator = const char*, T = char]': > math_mathmlstream.C:87: instantiated from here > ../../src/support/lyxalgo.h:84: error: dependent-name > 'std::iterator_traits<_Iterator>::difference_type' is parsed as a > non-type, but instantiation yields a type > ../../src/support/lyxalgo.h:84: note: say 'typename > std::iterator_traits<_Iterator>::difference_type' if a type is meant > make[4]: *** [math_mathmlstream.lo] Error 1
You found a bug. I corrected it now in svn (see attached patch). Nevertheless I don't understand why you don't have HAVE_STD_COUNT #defined, since you use a recent Linux distro, and gcc has std::count since a long time. Either something is still broken on your system, or our configure test for HAVE_STD_COUNT does not work correctly. Georg
Index: src/support/lyxalgo.h =================================================================== --- src/support/lyxalgo.h (Revision 14110) +++ src/support/lyxalgo.h (Arbeitskopie) @@ -81,7 +81,7 @@ count (Iterator first, Iterator last, T #ifdef HAVE_STD_COUNT return std::count(first, last, value); #else - std::iterator_traits<Iterator>::difference_type n = 0; + typename std::iterator_traits<Iterator>::difference_type n = 0; while (first != last) if (*first++ == value) ++n; return n;