sc/source/core/tool/scmatrix.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit d2dd5bf00a45f53fbd6d703f84878dfa9c0e3cf0
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Feb 4 13:52:39 2025 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Feb 4 15:56:30 2025 +0100

    Actually make wrapped_iterator a bidirectional_iterator
    
    ...which it claims to be.  Also, builds against recent LLVM 20 trunk libc++ 
(on
    macOS) had started to fail with
    
    > In file included from sc/source/core/tool/scmatrix.cxx:20:
    > In file included from sc/inc/scmatrix.hxx:22:
    > In file included from sc/inc/address.hxx:30:
    > In file included from sc/inc/types.hxx:14:
    > In file included from external/boost/include/boost/intrusive_ptr.hpp:30:
    > In file included from 
workdir/UnpackedTarball/boost/boost/intrusive_ptr.hpp:16:
    > In file included from 
workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:20:
    > In file included from ~/llvm/inst/bin/../include/c++/v1/functional:557:
    > In file included from 
~/llvm/inst/bin/../include/c++/v1/__functional/boyer_moore_searcher.h:25:
    > ~/llvm/inst/bin/../include/c++/v1/__vector/vector.h:1043:20: error: no 
matching function for call to object of type 'const __copy_n'
    >  1043 |       auto __mid = ranges::copy_n(std::move(__first), size(), 
this->__begin_).in;
    >       |                    ^~~~~~~~~~~~~~
    > ~/llvm/inst/bin/../include/c++/v1/__vector/vector.h:317:5: note: in 
instantiation of function template specialization 
'std::vector<double>::__assign_with_size<(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>, (anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here
    >   317 |     __assign_with_size(__first, __last, std::distance(__first, 
__last));
    >       |     ^
    > 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/../types.hpp:335:15:
 note: in instantiation of function template specialization 
'std::vector<double>::assign<(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>, 0>' requested here
    >   335 |         m_vec.assign(first, last);
    >       |               ^
    > 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/../types.hpp:718:11:
 note: in instantiation of function template specialization 
'mdds::mtv::delayed_delete_vector<double>::assign<(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here
    >   718 |         d.assign(it_begin, it_end);
    >       |           ^
    > 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/../standard_element_blocks.hpp:73:1:
 note: in instantiation of function template specialization 
'mdds::mtv::element_block<mdds::mtv::default_element_block<10, double>, 10, 
double, mdds::mtv::delayed_delete_vector>::assign_values<(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here
    >    73 | MDDS_MTV_DEFINE_ELEMENT_CALLBACKS(double, element_type_double, 
0.0, double_element_block)
    >       | ^
    > 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/macro.hpp:101:21: 
note: expanded from macro 'MDDS_MTV_DEFINE_ELEMENT_CALLBACKS'
    >   101 |         block_type::assign_values(dest, it_begin, it_end); \
    >       |                     ^
    > 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:2545:13:
 note: in instantiation of function template specialization 
'mdds::mtv::mdds_mtv_assign_values<(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here
    >  2545 |             mdds_mtv_assign_values(*blk_data, *it_begin, 
it_begin, it_end);
    >       |             ^
    > 
workdir/UnpackedTarball/mdds/include/mdds/multi_type_vector/soa/main_def.inl:2519:16:
 note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to 
see all)
    >  2519 |         return set_cells_to_single_block(row, end_row, 
block_index1, it_begin, it_end);
    >       |                ^
    > sc/source/core/tool/scmatrix.cxx:2419:29: note: in instantiation of 
function template specialization 'mdds::multi_type_matrix<(anonymous 
namespace)::matrix_traits>::set<(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>>' requested here
    >  2419 |                 pos = mrMat.set(pos,aFunc.begin(), aFunc.end());
    >       |                             ^
    > workdir/UnpackedTarball/mdds/include/mdds/multi_type_matrix.hpp:191:13: 
note: in instantiation of member function '(anonymous 
namespace)::MatrixOpWrapper<matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>>::operator()' requested here
    >   191 |             m_func(mtm_node);
    >       |             ^
    > ~/llvm/inst/bin/../include/c++/v1/__algorithm/for_each.h:33:5: note: in 
instantiation of member function 'mdds::multi_type_matrix<(anonymous 
namespace)::matrix_traits>::walk_func<(anonymous 
namespace)::MatrixOpWrapper<matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>>>::operator()' requested here
    >    33 |     __f(*__first);
    >       |     ^
    > sc/source/core/tool/scmatrix.cxx:2468:11: note: in instantiation of 
function template specialization 'mdds::multi_type_matrix<(anonymous 
namespace)::matrix_traits>::walk<(anonymous 
namespace)::MatrixOpWrapper<matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>>>' requested here
    >  2468 |     maMat.walk(aFunc);
    >       |           ^
    > sc/source/core/tool/scmatrix.cxx:3598:12: note: in instantiation of 
function template specialization 
'ScMatrixImpl::ApplyOperation<matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>>' requested here
    >  3598 |     pImpl->ApplyOperation(aOp, *rMat.pImpl);
    >       |            ^
    > ~/llvm/inst/bin/../include/c++/v1/__algorithm/ranges_copy_n.h:64:3: note: 
candidate template ignored: constraints not satisfied [with _Ip = 
__libcpp_remove_reference_t<wrapped_iterator<default_element_block<10, double, 
mdds::mtv::delayed_delete_vector>, MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double> &>, _Op = pointer]
    >    64 |   operator()(_Ip __first, iter_difference_t<_Ip> __n, _Op 
__result) const {
    >       |   ^
    > ~/llvm/inst/bin/../include/c++/v1/__algorithm/ranges_copy_n.h:61:13: 
note: because '(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' does not satisfy 
'input_iterator'
    >    61 |   template <input_iterator _Ip, weakly_incrementable _Op>
    >       |             ^
    > ~/llvm/inst/bin/../include/c++/v1/__iterator/concepts.h:154:26: note: 
because '(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' does not satisfy 
'input_or_output_iterator'
    >   154 | concept input_iterator = input_or_output_iterator<_Ip> && 
indirectly_readable<_Ip> && requires {
    >       |                          ^
    > ~/llvm/inst/bin/../include/c++/v1/__iterator/concepts.h:135:6: note: 
because '(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>' does not satisfy 
'weakly_incrementable'
    >   135 | } && weakly_incrementable<_Ip>;
    >       |      ^
    > ~/llvm/inst/bin/../include/c++/v1/__iterator/concepts.h:122:10: note: 
because '__i++' would be invalid: cannot increment value of type '(anonymous 
namespace)::wrapped_iterator<mdds::mtv::default_element_block<10, double>, 
matop::(anonymous namespace)::MatOp<(lambda at 
sc/source/core/tool/scmatrix.cxx:3596:17)>, double>'
    >   122 |       __i++;                      // not required to be 
equality-preserving
    >       |          ^
    
    etc.
    
    Change-Id: I1c49823d462c67bb73b16453ea44e5f2fe19d2e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181111
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 0f792203c66b..6ec0f437ac79 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -2318,6 +2318,13 @@ public:
         return *this;
     }
 
+    wrapped_iterator operator++(int)
+    {
+        auto const old = *this;
+        ++it;
+        return old;
+    }
+
     wrapped_iterator& operator--()
     {
         --it;
@@ -2325,6 +2332,13 @@ public:
         return *this;
     }
 
+    wrapped_iterator operator--(int)
+    {
+        auto const old = *this;
+        --it;
+        return old;
+    }
+
     value_type& operator*() const
     {
         val = calcVal();

Reply via email to