Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed compilation error in mfc.hpp with VS2022, MSVC 14.3 #144

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

tobias-loew
Copy link
Contributor

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.

It would be great if this fix could make it into 1.82, since the only "non-intrusive" way to fix this as user would be defining BOOST_RANGE_MFC_CONST_COL_RETURNS_NON_REF which affects also other collections.

`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<const X,const void *,boost::use_default,boost::use_default>::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<const X,const void *,boost::use_default,boost::use_default>::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<const X,const void *,boost::use_default,boost::use_default>' being compiled
1>        with
1>        [
1>            X=CPtrList
1>        ]

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants