[Boost-bugs] [Boost C++ Libraries] #4136: Boost.Range : put "using namespace boost::adaptors" creates conflict.

Subject: [Boost-bugs] [Boost C++ Libraries] #4136: Boost.Range : put "using namespace boost::adaptors" creates conflict.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-21 20:23:12


#4136: Boost.Range : put "using namespace boost::adaptors" creates conflict.
--------------------------------------+-------------------------------------
 Reporter: thomas.petit33@… | Owner: neilgroves
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: range
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
--------------------------------------+-------------------------------------
 Hi,[[BR]]

 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> ]
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4136>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC