Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#143 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Reproduce the failure in a small C++ console application using Boost 1.81, /std:c++20, and <boost/range/mfc.hpp>. Start with boost/range/detail/microsoft.hpp around lines 624-626 and use the diagnostics from boost/range/mfc.hpp line 881 to trace the iterator instantiation. Done means the include compiles successfully with the reported compiler configuration.

Written by the indexing model from the issue text.

Description

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

Dominant language
C++
Stars
45
Forks
104
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/range

All issues in boostorg/range

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.