Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1315: iterator_adaptor does not work with incomplete Value types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-24 14:36:22
#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
Resolution: | Keywords:
--------------------------------------+-------------------------------------
Comment (by Laurent Rineau <Laurent.Rineau__boost_at_[hidden]>):
I encounter this bug with a code example a bit more tricky:
{{{
#include <boost/iterator/iterator_facade.hpp>
template <class V>
struct Iterator
: public boost::iterator_facade<Iterator<V>,
V,
std::bidirectional_iterator_tag >
{
friend class boost::iterator_core_access;
bool equal(Iterator other) const { return true; }
V& dereference() const { V ref; return ref; }
void increment() {}
void decrement() {}
};
template < class T >
struct Vertex_base
{
typedef typename T::Face_iterator Face_iterator;
Face_iterator _f;
};
template < typename T>
struct Face_base
{
typedef typename T::Vertex_iterator Vertex_iterator;
Vertex_iterator V;
};
struct Triangulation
{
typedef Vertex_base<Triangulation> Vertex;
typedef Face_base<Triangulation> Face;
typedef Iterator<Face> Face_iterator;
typedef Iterator<Vertex> Vertex_iterator;
Vertex_iterator v;
};
int main()
{
Triangulation t;
return 0;
}
}}}
g++-4.1.2 and g++-4.3.0 do compile the code above, with boost-1.34.1 or
with boost trunk (revision 44750), but MSVC++ 8.0 does not (same error
diagnostic as the bug submitter):
{{{
cd c:/applis/downloads/boost_1_35_0/
cl.exe -I. facade.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.42 for x64
Copyright (C) Microsoft Corporation. Â All rights reserved.
facade.cpp
facade.cpp(42) : error C2148: total size of array must not exceed
0x7fffffff bytes
    .\boost/type_traits/is_class.hpp(76) : see reference to class
template instantiation 'Face_base<T>' being compiled
    with
    [
      T=Triangulation
    ]
    .\boost/type_traits/is_class.hpp(121) : see reference to class
template instantiation 'boost::detail::is_class_impl<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_enum.hpp(43) : see reference to class
template instantiation 'boost::is_class<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_enum.hpp(134) : see reference to class
template instantiation 'boost::detail::is_class_or_union<T>' being
compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_enum.hpp(166) : see reference to class
template instantiation 'boost::detail::is_enum_impl<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_scalar.hpp(29) : see reference to class
template instantiation 'boost::is_enum<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_scalar.hpp(49) : see reference to class
template instantiation 'boost::detail::is_scalar_impl<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_pod.hpp(34) : see reference to class
template instantiation 'boost::is_scalar<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/type_traits/is_pod.hpp(128) : see reference to class
template instantiation 'boost::detail::is_pod_impl<T>' being compiled
    with
    [
      T=Triangulation::Face
    ]
   Â
c:\applis\downloads\boost_1_35_0\boost/mpl/aux_/preprocessed/plain/and.hpp(51)
: see reference to class template instantiation 'boost::is_POD<T>' being
compiled
    with
    [
      T=Triangulation::Face
    ]
    .\boost/mpl/not.hpp(41) : see reference to class template
instantiation 'boost::mpl::and_<T1,T2>' being compiled
    with
    [
      T1=boost::is_POD<Triangulation::Face>,
     Â
T2=boost::detail::iterator_writability_disabled<Triangulation::Face,Face_base<Triangulation>
&>
    ]
    .\boost/iterator/iterator_facade.hpp(382) : see reference to class
template instantiation 'boost::mpl::not_<T>' being compiled
    with
    [
     Â
T=boost::mpl::and_<boost::is_POD<Triangulation::Face>,boost::detail::iterator_writability_disabled<Triangulation::Face,Face_base<Triangulation>
&>>
    ]
    .\boost/mpl/if.hpp(63) : see reference to class template
instantiation
'boost::detail::use_operator_brackets_proxy<ValueType,Reference>' being
compiled
    with
    [
      ValueType=Triangulation::Face,
      Reference=Face_base<Triangulation> &
    ]
    .\boost/iterator/iterator_facade.hpp(391) : see reference to class
template instantiation 'boost::mpl::if_<T1,T2,T3>' being compiled
    with
    [
     Â
T1=boost::detail::use_operator_brackets_proxy<Triangulation::Face,Face_base<Triangulation>
&>,
     Â
T2=boost::detail::operator_brackets_proxy<Iterator<Triangulation::Face>>,
      T3=Triangulation::Face
    ]
    .\boost/iterator/iterator_facade.hpp(652) : see reference to class
template instantiation
'boost::detail::operator_brackets_result<Iterator,Value,Reference>' being
compiled
    with
    [
      Iterator=Iterator<Triangulation::Face>,
      Value=Triangulation::Face,
      Reference=Face_base<Triangulation> &
    ]
    facade.cpp(8) : see reference to class template instantiation
'boost::iterator_facade<Derived,Value,CategoryOrTraversal>' being compiled
    with
    [
      Derived=Iterator<Triangulation::Face>,
      Value=Triangulation::Face,
      CategoryOrTraversal=std::bidirectional_iterator_tag
    ]
    facade.cpp(32) : see reference to class template instantiation
'Iterator<V>' being compiled
    with
    [
      V=Triangulation::Face
    ]
    .\boost/type_traits/is_class.hpp(76) : see reference to class
template instantiation 'Vertex_base<T>' being compiled
    with
    [
      T=Triangulation
    ]
    .\boost/type_traits/is_class.hpp(121) : see reference to class
template instantiation 'boost::detail::is_class_impl<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_enum.hpp(43) : see reference to class
template instantiation 'boost::is_class<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_enum.hpp(134) : see reference to class
template instantiation 'boost::detail::is_class_or_union<T>' being
compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_enum.hpp(166) : see reference to class
template instantiation 'boost::detail::is_enum_impl<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_scalar.hpp(29) : see reference to class
template instantiation 'boost::is_enum<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_scalar.hpp(49) : see reference to class
template instantiation 'boost::detail::is_scalar_impl<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_pod.hpp(34) : see reference to class
template instantiation 'boost::is_scalar<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/type_traits/is_pod.hpp(128) : see reference to class
template instantiation 'boost::detail::is_pod_impl<T>' being compiled
    with
    [
      T=Triangulation::Vertex
    ]
   Â
c:\applis\downloads\boost_1_35_0\boost/mpl/aux_/preprocessed/plain/and.hpp(51)
: see reference to class template instantiation 'boost::is_POD<T>' being
compiled
    with
    [
      T=Triangulation::Vertex
    ]
    .\boost/mpl/not.hpp(41) : see reference to class template
instantiation 'boost::mpl::and_<T1,T2>' being compiled
    with
    [
      T1=boost::is_POD<Triangulation::Vertex>,
     Â
T2=boost::detail::iterator_writability_disabled<Triangulation::Vertex,Vertex_base<Triangulation>
&>
    ]
    .\boost/iterator/iterator_facade.hpp(382) : see reference to class
template instantiation 'boost::mpl::not_<T>' being compiled
    with
    [
     Â
T=boost::mpl::and_<boost::is_POD<Triangulation::Vertex>,boost::detail::iterator_writability_disabled<Triangulation::Vertex,Vertex_base<Triangulation>
&>>
    ]
    .\boost/mpl/if.hpp(63) : see reference to class template
instantiation
'boost::detail::use_operator_brackets_proxy<ValueType,Reference>' being
compiled
    with
    [
      ValueType=Triangulation::Vertex,
      Reference=Vertex_base<Triangulation> &
    ]
    .\boost/iterator/iterator_facade.hpp(391) : see reference to class
template instantiation 'boost::mpl::if_<T1,T2,T3>' being compiled
    with
    [
     Â
T1=boost::detail::use_operator_brackets_proxy<Triangulation::Vertex,Vertex_base<Triangulation>
&>,
     Â
T2=boost::detail::operator_brackets_proxy<Iterator<Triangulation::Vertex>>,
      T3=Triangulation::Vertex
    ]
    .\boost/iterator/iterator_facade.hpp(652) : see reference to class
template instantiation
'boost::detail::operator_brackets_result<Iterator,Value,Reference>' being
compiled
    with
    [
      Iterator=Iterator<Triangulation::Vertex>,
      Value=Triangulation::Vertex,
      Reference=Vertex_base<Triangulation> &
    ]
    facade.cpp(8) : see reference to class template instantiation
'boost::iterator_facade<Derived,Value,CategoryOrTraversal>' being compiled
    with
    [
      Derived=Iterator<Triangulation::Vertex>,
      Value=Triangulation::Vertex,
      CategoryOrTraversal=std::bidirectional_iterator_tag
    ]
    facade.cpp(54) : see reference to class template instantiation
'Iterator<V>' being compiled
    with
    [
      V=Triangulation::Vertex
    ]
facade.cpp(42) : error C2079: 'Face_base<T>::V' uses undefined struct
'Iterator<V>'
    with
    [
      T=Triangulation
    ]
    and
    [
      V=Triangulation::Vertex
    ]
Compilation exited abnormally with code 2 at Thu Apr 24 13:19:24
}}}
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1315#comment:1>
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:57 UTC