|
Boost : |
From: Daryle Walker (darylew_at_[hidden])
Date: 2002-01-13 00:18:07
Before we go any further, we should go through <boost/iterator_adaptors.hpp>
and do a search & replace for "::template" with "::BOOST_NESTED_TEMPLATE".
Similar fixes needed to be done for <boost/multi_array/base.hpp> and
<boost/multi_array/range_list.hpp>. I'm using an old compiler (Metrowerks
CodeWarrior Pro 5.3) and old computer (PowerMac 7200/90), so these fixes
will help.
The author may want to #include Boost files as <boost/XXX.hpp> instead
"boost/XXX.hpp". You may not agree with the use of the former form, but we
should be consistent.
I didn't do any of the regression stuff in the status and test directories.
Out of the examples, only "basic2.cpp" and "op_paren.cpp" compiled with no
problems (after doing the fixes in the first paragraph, of course).
All the other examples ("basic1.cpp", "foreach_test.cpp",
"foreach_test2.cpp", "print_array.cpp", "subview.cpp", and "subview2.cpp")
had the following two warnings:
//=========================================================================
Warning : illegal const/volatile '&' reference initialization
(instantiating:
'std::transform<PCQ45boost6detail11multi_array18extent_range<i,Ul>,Pi,Q25boo
st65mem_fun_ref_t<i,Q45boost6detail11multi_array18extent_range<i,Ul>>>(const
boost::detail::multi_array::extent_range<int, unsigned long> *, const
boost::detail::multi_array::extent_range<int, unsigned long> *, int *,
boost::mem_fun_ref_t<int, boost::detail::multi_array::extent_range<int,
unsigned long>>)')
algorithm line 584 *result = op(*first);
Warning : illegal const/volatile '&' reference initialization
(instantiating:
'std::transform<PCQ45boost6detail11multi_array18extent_range<i,Ul>,Pi,Q25boo
st66mem_fun_ref_t<Ul,Q45boost6detail11multi_array18extent_range<i,Ul>>>(cons
t boost::detail::multi_array::extent_range<int, unsigned long> *, const
boost::detail::multi_array::extent_range<int, unsigned long> *, int *,
boost::mem_fun_ref_t<unsigned long,
boost::detail::multi_array::extent_range<int, unsigned long>>)')
algorithm line 584 *result = op(*first);
//=========================================================================
The "foreach_test.cpp", "foreach_test2.cpp", and "print_array.cpp" files
also get the following error:
//=========================================================================
Error : function call 'equal(const
boost::iterator_adaptor<boost::detail::multi_array::iterator_base<double,
double *>, boost::detail::multi_array::iterator_policies<double, 2>,
boost::multi_array<double, 1, std::allocator<double>>,
boost::detail::multi_array::sub_array<double, 1>, boost::multi_array<double,
1, std::allocator<double>> *, std::input_iterator_tag, int>, const
boost::iterator_adaptor<boost::detail::multi_array::iterator_base<double,
double *>, boost::detail::multi_array::iterator_policies<double, 2>,
boost::multi_array<double, 1, std::allocator<double>>,
boost::detail::multi_array::sub_array<double, 1>, boost::multi_array<double,
1, std::allocator<double>> *, std::input_iterator_tag, int>)' does not match
'boost::detail::multi_array::iterator_policies<double, 2>::equal(T1_0 &,
T1_1 &)const '
(instantiating:
'boost::__ne<Q45boost6detail11multi_array19iterator_base<d,Pd>,Q45boost6deta
il11multi_array19iterator_base<d,Pd>,Q45boost6detail11multi_array22iterator_
policies<d,2>,Q25boost37multi_array<d,1,Q23std12allocator<d>>,Q25boost37mult
i_array<d,1,Q23std12allocator<d>>,Q45boost6detail11multi_array14sub_array<d,
1>,Q45boost6detail11multi_array14sub_array<d,1>,PQ25boost37multi_array<d,1,Q
23std12allocator<d>>,PQ25boost37multi_array<d,1,Q23std12allocator<d>>,Q23std
18input_iterator_tag,i>(const
boost::iterator_adaptor<boost::detail::multi_array::iterator_base<double,
double *>, boost::detail::multi_array::iterator_policies<double, 2>,
boost::multi_array<double, 1, std::allocator<double>>,
boost::detail::multi_array::sub_array<double, 1>, boost::multi_array<double,
1, std::allocator<double>> *, std::input_iterator_tag, int> &, const
boost::iterator_adaptor<boost::detail::multi_array::iterator_base<double,
double *>, boost::detail::multi_array::iterator_policies<double, 2>,
boost::multi_array<double, 1, std::allocator<double>>,
boost::detail::multi_array::sub_array<double, 1>, boost::multi_array<double,
1, std::allocator<double>> *, std::input_iterator_tag, int> &)')
iterator_adaptors.hpp line 1011 return !x.policies().equal(x, y);
//=========================================================================
I'm going to try compiling the programs that had just warnings....
...And they seem to work.
You may want to add routines to let a function (object) be applied to each
element. But maybe that can be simulated with std::transform and the array
iterators. I agree with others that full arithmetic functions should be
delayed to other types that use these types as implementation, since there
are several directions to proceed. I also agree that a public algorithm
library is too orthogonal (and potentially large) to be sneaked in through
this library, especially if it carries STL-copyrighted stuff.
It should be accepted, if the concerns others have mentioned get resolved.
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk