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

#include <boost/range/mfc.hpp> causes a compilation error #143

Open
gabrielbocek opened this issue Apr 5, 2023 · 7 comments
Open

#include <boost/range/mfc.hpp> causes a compilation error #143

gabrielbocek opened this issue Apr 5, 2023 · 7 comments

Comments

@gabrielbocek
Copy link

gabrielbocek commented Apr 5, 2023

Hi,
I updated the visual C++ compiler from 17.0.6 to 17.4.6 and I'm getting a compilation error by including <boost/range/mfc.hpp>:

1>\boost\range\detail\microsoft.hpp(626,33): error C2440: 'return': cannot convert from 'const void *' to 'const void *&'
1>\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>\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>\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> ]

The project is compiled with /std:c++20 switch.

This is easily reproducible - it is just needed to create a C++ console application, add the include to <boost/range/mfc.hpp> to one cpp file, add boost directory to include directories and set the compiler flag /std:c++20.

I'm using boost 1.81.

Best regards,
Gabriel

@malcolmdavey
Copy link

Same - VS 17.4.x, C++20

@tobias-loew
Copy link
Contributor

I made a non-intrusive fix #144. But it isn't merged yet. 🙁

@gabrielbocek
Copy link
Author

@tobias-loew How can we speed up the merge? I see that you made the fix in April '23.

@tobias-loew
Copy link
Contributor

It just happened! (Even without the need for defining the macro: the old code was broken anyway.)

@gabrielbocek
Copy link
Author

Somehow this fix is still not part of the Boost 1.84. Can you please clarify?

@tobias-loew
Copy link
Contributor

@neilgroves Any chance to get #144 fix into the boost-release?
(There are several other commits also waiting for release. The last merge into master was May 2021)

@neilgroves
Copy link
Collaborator

neilgroves commented Jan 12, 2024 via email

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

No branches or pull requests

4 participants