[Boost-bugs] [Boost C++ Libraries] #1315: iterator_adaptor does not work with incomplete Value types

Subject: [Boost-bugs] [Boost C++ Libraries] #1315: iterator_adaptor does not work with incomplete Value types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-10-11 12:05:46


#1315: iterator_adaptor does not work with incomplete Value types
-------------------------------------+--------------------------------------
 Reporter: joaquin | Owner: dave
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: iterator
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 boost::iterator_adaptor doesn't work when the associated Value type is
 incomplete,
 at least in MSVC++ 8.0 (my hunch is that the problem is general). The
 following
 {{{
 #include <boost/iterator/iterator_adaptor.hpp>

 template<typename T>
 struct my_iterator:
   boost::iterator_adaptor<my_iterator<T>,T*>
 {
 };

 struct foo
 {
   my_iterator<foo> it;
 };

 int main(){}

 }}}
 results in:
 {{{
 ...\boost\type_traits\is_pod.hpp(34) : error C2139: 'foo' :
 an undefined class is not allowed as an argument to compiler
 intrinsic type trait '__is_pod'
     ...\sandbox.cpp(10) : see declaration of 'foo'
     ...\type_traits\is_pod.hpp(128) : see reference to class template
     instantiation 'boost::detail::is_pod_impl<T>' being compiled
 [...]
     ...\boost\iterator\iterator_facade.hpp(652) : see reference to
     class templateinstantiation
     'boost::detail::operator_brackets_result<Iterator,Value,Reference>'
     being compiled
     with
     [
         Iterator=my_iterator<foo>,
         Value=foo,
         Reference=foo &
     ]
 [...]
 }}}
 Although this is probably not a bug strictly speaking, it would be fine
 if iterator_adaptor could be made to work with incomplete Value types,
 just as the canonical model for iterators, Value*, does.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1315>
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:49:56 UTC