From 97953a126ecbb364144a33937fc7cd75948c8024 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 6 Jan 2022 12:22:55 +0300 Subject: [PATCH] Add 'reference' to the iterator_traits, needed by LegacyIterator reqs This addressed a failure with VS2022 Version 17.1.0 Preview 2.0: C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(1152): error C2794: 'reference': is not a member of any direct or in direct base class of 'std::iterator_traits<`anonymous-namespace'::lcl_DataSeriesContainerAppend>' C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3932): note: see reference to alias template instantiation 'std::_Iter_ref_t<`anonymous-namespace'::lcl_DataSeriesContainerAppend>' being compiled C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3992): note: see reference to variable template 'const bool _Iterator_is_volatile<`anonymous namespace'::lcl_DataSeriesContainerAppend>' being compiled C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(4048): note: see reference to function template instantiation '_OutIt std::_Copy_unchecked*,_OutIt>(_InIt,_InIt,_OutIt)' being compiled with [ _OutIt=`anonymous-namespace'::lcl_DataSeriesContainerAppend, _InIt=com::sun::star::uno::Reference * ] C:/lo/src/core/chart2/source/controller/dialogs/DialogModel.cxx(504): note: see reference to function template instantiation '_OutIt std::copy>>,`anonymous-namespace'::lcl_DataSeriesContainerAppend>(_InIt,_InIt,_OutIt)' being compiled with [ _OutIt=`anonymous-namespace'::lcl_DataSeriesContainerAppend, _Ty=com::sun::star::uno::Reference, _InIt=std::_Vector_iterator>>> ] C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3932): error C2938: 'std::_Iter_ref_t' : Failed to specialize alias template C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3932): error C2062: type 'unknown-type' unexpected C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3992): error C3376: 'std::_Iterator_is_volatile': only static data member templates are allowed C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(4026): error C2976: 'std::_Iter_copy_cat': too few template arguments C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3994): note: see declaration of 'std::_Iter_copy_cat' C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(1152): error C2794: 'reference': is not a member of any direct or in direct base class of 'std::iterator_traits<`anonymous-namespace'::lcl_RolesWithRangeAppend>' C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3932): note: see reference to alias template instantiation 'std::_Iter_ref_t<`anonymous-namespace'::lcl_RolesWithRangeAppend>' being compiled C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(3992): note: see reference to variable template 'const bool _Iterator_is_volatile<`anonymous namespace'::lcl_RolesWithRangeAppend>' being compiled C:\PROGRA~1\MIB055~1\2022\Preview\VC\Tools\MSVC\1431~1.309\Include\xutility(4048): note: see reference to function template instantiation '_OutIt std::_Copy_unchecked<_InIt,_OutIt>(_InIt,_InIt,_OutIt)' being compiled with [ _OutIt=`anonymous-namespace'::lcl_RolesWithRangeAppend, _InIt=const com::sun::star::uno::Reference * ] C:/lo/src/core/chart2/source/controller/dialogs/DialogModel.cxx(563): note: see reference to function template instantiation '_OutIt std::copy(_InIt,_InIt,_OutIt)' being compiled with [ _OutIt=`anonymous-namespace'::lcl_RolesWithRangeAppend, E=com::sun::star::uno::Reference, _InIt=const com::sun::star::uno::Reference * ] make[1]: *** [C:/lo/src/core/solenv/gbuild/LinkTarget.mk:332: C:/lo/src/build/workdir/CxxObject/chart2/source/controller/dialogs/DialogModel.o] Error 2 Change-Id: Ic93dc7922cd48870ef62bfd682dd5cbdc827a255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128036 Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski (cherry picked from commit 0bc5584ef296683c015357232d48180b85f8baac) --- chart2/source/controller/dialogs/DialogModel.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx index ce6da753d6c4..9c735a489b5e 100644 --- a/chart2/source/controller/dialogs/DialogModel.cxx +++ b/chart2/source/controller/dialogs/DialogModel.cxx @@ -241,12 +241,14 @@ namespace std { typedef std::output_iterator_tag iterator_category; typedef Reference< XDataSeriesContainer > value_type; + typedef value_type& reference; }; template<> struct iterator_traits { typedef std::output_iterator_tag iterator_category; typedef Reference< data::XLabeledDataSequence > value_type; + typedef value_type& reference; }; } -- 2.11.4.GIT