>>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

Lars> [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes: | The only think
Lars> left that I'd like to change is the iterators, | currently
Lars> ÂRandomccessList::iterator is an bi-directional iterator, | but
Lars> not a random iterator, as such several operation are pretty |
Lars> costly.

Lars> This patch has that change. I am not overly confident in it, but
Lars> it seems to work as it should. It would be great if those of you
Lars> seeing speed problems due to slow ParagraphList could try this
Lars> patch. With USE_CONTAINER_ITERATOR set to both 0 and 1. (0 will
Lars> use a bidirectional iterator std::list::iterator, 1 will use a
Lars> random access iterator std::vector::iterator)

With USE_CONTAINER_ITERATOR set to 0, I get the following.

JMarc

if g++ -DHAVE_CONFIG_H -I. -I../../1.4.x/src -I.  -Winvalid-pch 
--include=../../1.4.x/src/pch.h -I../../1.4.x/boost -Wextra -Wall   
-I/afs/rocq/home/preval/common/include   -I/usr/X11R6/include -fno-exceptions 
-g -O -MT CutAndPaste.o -MD -MP -MF ".deps/CutAndPaste.Tpo" -c -o CutAndPaste.o 
../../1.4.x/src/CutAndPaste.C; \
then mv -f ".deps/CutAndPaste.Tpo" ".deps/CutAndPaste.Po"; else rm -f 
".deps/CutAndPaste.Tpo"; exit 1; fi
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:
 In member function `void 
__gnu_cxx::_ForwardIteratorConcept<_Tp>::__constraints() [with _Tp = 
RandomAccessList<Paragraph>::iterator]':
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:62:
   instantiated from `void __gnu_cxx::__function_requires() [with _Concept = 
__gnu_cxx::_ForwardIteratorConcept<RandomAccessList<Paragraph>::iterator>]'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:502:
   instantiated from `void 
__gnu_cxx::_BidirectionalIteratorConcept<_Tp>::__constraints() [with _Tp = 
RandomAccessList<Paragraph>::iterator]'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:62:
   instantiated from `void __gnu_cxx::__function_requires() [with _Concept = 
__gnu_cxx::_BidirectionalIteratorConcept<RandomAccessList<Paragraph>::iterator>]'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:528:
   instantiated from `void 
__gnu_cxx::_RandomAccessIteratorConcept<_Tp>::__constraints() [with _Tp = 
RandomAccessList<Paragraph>::iterator]'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:62:
   instantiated from `void __gnu_cxx::__function_requires() [with _Concept = 
__gnu_cxx::_RandomAccessIteratorConcept<RandomAccessList<Paragraph>::iterator>]'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/stl_iterator_base_funcs.h:153:
   instantiated from `void std::__advance(_RandomAccessIterator&, _Distance, 
std::random_access_iterator_tag) [with _RandomAccessIterator = 
RandomAccessList<Paragraph>::iterator, _Distance = int]'
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/stl_iterator_base_funcs.h:175:
   instantiated from `void std::advance(_InputIterator&, _Distance) [with 
_InputIterator = RandomAccessList<Paragraph>::iterator, _Distance = int]'
../../1.4.x/boost/boost/next_prior.hpp:35:   instantiated from `T 
boost::next(T, Distance) [with T = RandomAccessList<Paragraph>::iterator, 
Distance = int]'
../../1.4.x/src/support/RandomAccessList.h:140:   instantiated from 
`RandomAccessList<T>::iterator 
RandomAccessList<T>::iterator::operator+(typename __gnu_debug_def::list<T, 
std::allocator<_CharT> >::difference_type) const [with T = Paragraph]'
../../1.4.x/src/CutAndPaste.C:217:   instantiated from here
/usr/lib/gcc/i586-mandrake-linux-gnu/3.4.1/../../../../include/c++/3.4.1/bits/boost_concept_check.h:483:
 error: invalid initialization of reference of type 
'__gnu_debug::_Safe_iterator<__gnu_norm::_List_iterator<Paragraph>, 
__gnu_debug_def::list<Paragraph, std::allocator<Paragraph> > >&' from 
expression of type 'Paragraph'
make[3]: *** [CutAndPaste.o] Error 1


Reply via email to