From d52236c0b89cde09748b20b7cbd805063debbd8f Mon Sep 17 00:00:00 2001 From: Tobias Loew Date: Wed, 12 Apr 2023 09:04:41 +0200 Subject: [PATCH] fixed compilation error in mfc.hpp with VS2022, MSVC 14.3 `const CObList` and `const CPtrList` still return a value from `GetHead`, `GetTail` and `GetAt`. MSVC 14.2 didn't complain about it, but 14.3 does so. ``` 1>D:\boost\range\detail\microsoft.hpp(626,33): error C2440: 'return': cannot convert from 'const void *' to 'const void *&' 1>D:\boost\range\detail\microsoft.hpp(624,1): message : while compiling class template member function 'const void *&boost::range_detail_microsoft::list_iterator::dereference(void) const' 1> with 1> [ 1> X=CPtrList 1> ] 1>D:\boost\iterator\iterator_facade.hpp(631,11): message : see reference to function template instantiation 'const void *&boost::range_detail_microsoft::list_iterator::dereference(void) const' being compiled 1> with 1> [ 1> X=CPtrList 1> ] 1>D:\boost\range\mfc.hpp(881,1): message : see reference to class template instantiation 'boost::range_detail_microsoft::list_iterator' being compiled 1> with 1> [ 1> X=CPtrList 1> ] ``` --- include/boost/range/mfc.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/include/boost/range/mfc.hpp b/include/boost/range/mfc.hpp index 058e54ec6..ac025fbaa 100644 --- a/include/boost/range/mfc.hpp +++ b/include/boost/range/mfc.hpp @@ -292,11 +292,8 @@ namespace boost { namespace range_detail_microsoft { struct meta { typedef list_iterator mutable_iterator; - #if !defined(BOOST_RANGE_MFC_CONST_COL_RETURNS_NON_REF) - typedef list_iterator const_iterator; - #else + // const CObList and const CPtrList both return a value (and probably always will) typedef list_iterator const_iterator; - #endif }; }; @@ -309,11 +306,8 @@ namespace boost { namespace range_detail_microsoft { struct meta { typedef list_iterator mutable_iterator; - #if !defined(BOOST_RANGE_MFC_CONST_COL_RETURNS_NON_REF) - typedef list_iterator const_iterator; - #else + // const CObList and const CPtrList both return a value (and probably always will) typedef list_iterator const_iterator; - #endif }; };