Hi Georg,

It is not possible currently to compile with gcc 4.6 in C++11 mode because lyxalgo.h declares its own next() method. This is because the code depends on __cplusplus >= 201103L, which is not true for this version of the compiler.

I would propose to replace this test with a test on whether c++11 mode has been selected by configure. Then it would be our responsibility to forbid if needed C++11 mode in too old compilers.

The alternative would be to actually check whether the compiler supports std::next().

JMarc

  CXX    CutAndPaste.o
../../master/src/CutAndPaste.cpp: In function ‘lyx::{anonymous}::PasteReturnValue lyx::{anonymous}::pasteSelectionHelper(const lyx::DocIterator&, const lyx::ParagraphList&, lyx::DocumentClassConstPtr, lyx::Buffer*, lyx::ErrorList&)’: ../../master/src/CutAndPaste.cpp:390:37: erreur: call of overloaded ‘next(lyx::RandomAccessList<lyx::Paragraph>::iterator, lyx::pit_type&)’ is ambiguous
../../master/src/CutAndPaste.cpp:390:37: note: candidates are:
../../master/src/support/lyxalgo.h:92:11: note: It lyx::next(It, Diff) [with It = __gnu_debug::_Safe_iterator<std::__cxx1998::_List_iterator<lyx::Paragraph>, std::__debug::list<lyx::Paragraph, std::allocator<lyx::Paragraph> > >, Diff = long int] /usr/include/c++/4.6/bits/stl_iterator_base_funcs.h:182:5: note: _ForwardIterator std::next(_ForwardIterator, typename std::iterator_traits<_Iter>::difference_type) [with _ForwardIterator = __gnu_debug::_Safe_iterator<std::__cxx1998::_List_iterator<lyx::Paragraph>, std::__debug::list<lyx::Paragraph, std::allocator<lyx::Paragraph> > >, typename std::iterator_traits<_Iter>::difference_type = long int]

Reply via email to