Boost logo

Ublas :

From: Nico Galoppo (ngaloppo_at_[hidden])
Date: 2008-02-06 15:20:52


On a related note, this fails with regular std::vector<> as well (not
only multi_array)

--nico

On Feb 6, 2008 12:22 PM, Nico Galoppo <ngaloppo_at_[hidden]> wrote:
> This test program fails to compile on my machine. Can anyone shed some
> light on why this is happening?
>
> #include <boost/numeric/ublas/vector.hpp>
> #include <boost/multi_array.hpp>
>
> int main()
> {
> typedef boost::numeric::ublas::vector<double> T;
> boost::multi_array<T, 2> a,b;
>
> return (a == b);
> }
>
> $ g++ -I/opt/include test.cpp
> /usr/include/c++/4.0.0/bits/stl_algobase.h: In function 'bool
> std::equal(_InputIterator1, _InputIterator1, _InputIterator2) [with
> _InputIterator1 =
> boost::detail::multi_array::array_iterator<main()::T, const
> main()::T*, mpl_::size_t<1ul>, const main()::T&>, _InputIterator2 =
> boost::detail::multi_array::array_iterator<main()::T, const
> main()::T*, mpl_::size_t<1ul>, const main()::T&>]':
> /opt/include/boost/multi_array/subarray.hpp:117: instantiated from
> 'bool boost::detail::multi_array::const_sub_array<T, NumDims,
> TPtr>::operator==(const boost::detail::multi_array::const_sub_array<T,
> NumDims, OPtr>&) const [with OPtr = const main()::T*, T = main()::T,
> long unsigned int NumDims = 1ul, TPtr = const main()::T*]'
> /usr/include/c++/4.0.0/bits/stl_algobase.h:760: instantiated from
> 'bool std::equal(_InputIterator1, _InputIterator1, _InputIterator2)
> [with _InputIterator1 =
> boost::detail::multi_array::array_iterator<main()::T, const
> main()::T*, mpl_::size_t<2ul>,
> boost::detail::multi_array::const_sub_array<main()::T, 1ul, const
> main()::T*> >, _InputIterator2 =
> boost::detail::multi_array::array_iterator<main()::T, const
> main()::T*, mpl_::size_t<2ul>,
> boost::detail::multi_array::const_sub_array<main()::T, 1ul, const
> main()::T*> >]'
> /opt/include/boost/multi_array/multi_array_ref.hpp:273: instantiated
> from 'bool boost::const_multi_array_ref<T, NumDims,
> TPtr>::operator==(const boost::const_multi_array_ref<T, NumDims,
> OPtr>&) const [with OPtr = main()::T*, T = main()::T, long unsigned
> int NumDims = 2ul, TPtr = main()::T*]'
> test.cpp:9: instantiated from here
> /usr/include/c++/4.0.0/bits/stl_algobase.h:760: error: no match for
> 'operator==' in
> '((boost::iterator_facade<boost::detail::multi_array::array_iterator<main()::T,
> const main()::T*, mpl_::size_t<1ul>, const main()::T&>, main()::T,
> boost::random_access_traversal_tag, const main()::T&, ptrdiff_t>*)(&
> __first1))->boost::iterator_facade<I, V, TC, R, D>::operator* [with
> Derived = boost::detail::multi_array::array_iterator<main()::T, const
> main()::T*, mpl_::size_t<1ul>, const main()::T&>, Value = main()::T,
> CategoryOrTraversal = boost::random_access_traversal_tag, Reference =
> const main()::T&, Difference = ptrdiff_t]() ==
> ((boost::iterator_facade<boost::detail::multi_array::array_iterator<main()::T,
> const main()::T*, mpl_::size_t<1ul>, const main()::T&>, main()::T,
> boost::random_access_traversal_tag, const main()::T&, ptrdiff_t>*)(&
> __first2))->boost::iterator_facade<I, V, TC, R, D>::operator* [with
> Derived = boost::detail::multi_array::array_iterator<main()::T, const
> main()::T*, mpl_::size_t<1ul>, const main()::T&>, Value = main()::T,
> CategoryOrTraversal = boost::random_access_traversal_tag, Reference =
> const main()::T&, Difference = ptrdiff_t]()'
>
>
> --
> Nico Galoppo :: http://www.ngaloppo.org
>

-- 
Nico Galoppo :: http://www.ngaloppo.org