#4136 closed Bugs (fixed)
Boost.Range : put "using namespace boost::adaptors" creates conflict.
| Reported by: | Owned by: | Neil Groves | |
|---|---|---|---|
| Milestone: | Boost 1.43.0 | Component: | range | 
| Version: | Boost 1.42.0 | Severity: | Problem | 
| Keywords: | Cc: | 
Description
Hi,
With the current version on the trunk, I get compilation errors with the following program (MSCV10 RC1).
#include <boost/range/adaptors.hpp>
using namespace boost::adaptors;
int main()
{
}
Message error : "1>F:\Program Files\boost\boost/range/iterator.hpp(63): error C2039: 'type' : is not a member of 'boost::mpl::eval_if_c<C,F1,F2>'" ...
See [1] to get the full message error.
I narrowed down the problem to the three adaptors "copied, sliced and tokenized". See below :
// Uncomment one the three adaptors below to get the same compilation error
// #include <boost/range/adaptor/copied.hpp>
// #include <boost/range/adaptor/sliced.hpp>
// #include <boost/range/adaptor/tokenized.hpp>
// these one are fine
#include <boost/range/adaptor/adjacent_filtered.hpp>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/adaptor/indexed.hpp>
#include <boost/range/adaptor/indirected.hpp>
#include <boost/range/adaptor/map.hpp>
#include <boost/range/adaptor/replaced.hpp>
#include <boost/range/adaptor/replaced_if.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/adaptor/strided.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/adaptor/uniqued.hpp>
using namespace boost::adaptors;
int main()
{
}
[1] full error message
1> Creating "Release\TestRangeEx.unsuccessfulbuild" because "AlwaysCreate" was specified. 1>ClCompile: 1> main.cpp 1>F:\Program Files\boost\boost/range/iterator.hpp(63): error C2039: 'type' : is not a member of 'boost::mpl::eval_if_c<C,F1,F2>' 1> with 1> [ 1> C=false, 1> F1=boost::range_const_iterator<unsigned int>, 1> F2=boost::range_mutable_iterator<unsigned int> 1> ] 1> F:\Program Files\Microsoft Visual Studio 10.0\VC\include\xstring(1920) : see reference to class template instantiation 'boost::range_iterator<C>' being compiled 1> with 1> [ 1> C=unsigned int 1> ] 1> F:\Program Files\Microsoft Visual Studio 10.0\VC\include\xstring(1919) : while compiling class template member function 'void std::basic_string<_Elem,_Traits,_Ax>::_Copy(unsigned int,unsigned int)' 1> with 1> [ 1> _Elem=wchar_t, 1> _Traits=std::char_traits<wchar_t>, 1> _Ax=std::allocator<wchar_t> 1> ] 1> F:\Program Files\Microsoft Visual Studio 10.0\VC\include\xfunctional(900) : see reference to class template instantiation 'std::basic_string<_Elem,_Traits,_Ax>' being compiled 1> with 1> [ 1> _Elem=wchar_t, 1> _Traits=std::char_traits<wchar_t>, 1> _Ax=std::allocator<wchar_t> 1> ] 1>F:\Program Files\boost\boost/range/iterator.hpp(63): error C2146: syntax error : missing ';' before identifier 'type' 1>F:\Program Files\boost\boost/range/iterator.hpp(63): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>F:\Program Files\boost\boost/range/iterator.hpp(63): error C2602: 'boost::range_iterator<C>::type' is not a member of a base class of 'boost::range_iterator<C>' 1> with 1> [ 1> C=unsigned int 1> ] 1> F:\Program Files\boost\boost/range/iterator.hpp(63) : see declaration of 'boost::range_iterator<C>::type' 1> with 1> [ 1> C=unsigned int 1> ] 1>F:\Program Files\boost\boost/range/iterator.hpp(63): error C2868: 'boost::range_iterator<C>::type' : illegal syntax for using-declaration; expected qualified-name 1> with 1> [ 1> C=unsigned int 1> ]
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
comment:3 by , 10 years ago
Hm, so this was closed two years ago? I face this issue today. A regression?
  Note:
 See   TracTickets
 for help on using tickets.
    
I am facing the same issue, and I observe the problem with both MSVC 9.0 and 10.0. My code base run with gcc version 4.3.4. So seems to be strictly a MSVC problem.
Has a solution been found and if no, Whats the time frame. If yes is it in a branch?
thanks Ray