Boost 1.56.0 compilation error in iterator_range
I get a compilation error with vc10, iterator_range and a (const)
unordered_map (the beta candidate 2 was still ok I think):
#include "stdafx.h"
#include
On 8/9/2014 4:10 AM, gast128 wrote:
I get a compilation error with vc10, iterator_range and a (const) unordered_map (the beta candidate 2 was still ok I think):
#include "stdafx.h" #include
#include int _tmain(int /*argc*/, _TCHAR* /*argv*/[]) { typedef boost::unordered_map
Container; typedef Container::const_iterator ContainerIterator; typedef boost::iterator_range<ContainerIterator> ContainerIteratorRange; const Container cnt;
ContainerIteratorRange rng(cnt.cbegin(), cnt.cend());
return 0; }
This gives C2248:
'boost::unordered::iterator_detail::c_iterator
::iterator' cannot access private typedef declared in class
Well, this is unfortunate. It's broken also on msvc-12 and clang trunk, but strangely not on gcc. I thought it might be due to this change in Boost.Range: https://github.com/boostorg/range/commit/264017e2a9bdbfcc24517ce05f8ef96df0a... But reverting that doesn't have any effect. It works on Boost 1.55, so this is definitely a regression. Can you please file a bug? Neil, can you take a look? Thanks, Eric
On 8/9/2014 12:46 PM, Eric Niebler wrote:
On 8/9/2014 4:10 AM, gast128 wrote:
I get a compilation error with vc10, iterator_range and a (const) unordered_map (the beta candidate 2 was still ok I think):
#include "stdafx.h" #include
#include int _tmain(int /*argc*/, _TCHAR* /*argv*/[]) { typedef boost::unordered_map
Container; typedef Container::const_iterator ContainerIterator; typedef boost::iterator_range<ContainerIterator> ContainerIteratorRange; const Container cnt;
ContainerIteratorRange rng(cnt.cbegin(), cnt.cend());
return 0; }
This gives C2248:
'boost::unordered::iterator_detail::c_iterator
::iterator' cannot access private typedef declared in class
A possible fix: https://github.com/boostorg/range/pull/19 \e
On 8/9/2014 11:55 PM, Eric Niebler wrote:
On 8/9/2014 12:46 PM, Eric Niebler wrote:
On 8/9/2014 4:10 AM, gast128 wrote:
I get a compilation error with vc10, iterator_range and a (const) unordered_map (the beta candidate 2 was still ok I think):
#include "stdafx.h" #include
#include int _tmain(int /*argc*/, _TCHAR* /*argv*/[]) { typedef boost::unordered_map
Container; typedef Container::const_iterator ContainerIterator; typedef boost::iterator_range<ContainerIterator> ContainerIteratorRange; const Container cnt;
ContainerIteratorRange rng(cnt.cbegin(), cnt.cend());
return 0; }
This gives C2248:
'boost::unordered::iterator_detail::c_iterator
::iterator' cannot access private typedef declared in class
A possible fix: https://github.com/boostorg/range/pull/19
\e
participants (2)
-
Eric Niebler
-
gast128