Boost logo

Boost :

From: Hamish Mackenzie (hamish_at_[hidden])
Date: 2002-04-16 06:24:15


On Tue, 2002-04-16 at 01:36, David Abrahams wrote:
> Were you looking on the mpl_v2 branch?

Ahh... Code looks a lot more like the doc now :-)

> > Wont it still end up with N * fold_step in the message, which has four
> > template arguments (as opposed to two)?
>
> I don't think so. Why don't you try it and find out? Speculation is a
> waste of time when you can verify.

I have had a crack. I have attached the source code and the results.

Here are the commands used to invoke the test
time g++ mpl_test.cpp -I ../boost/boost/ 2>test1.txt
time g++ mpl_test.cpp -I ../boost/boost/ -DTEST2 2>test2.txt
g++ -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/specs
Configured with: ../gcc-3.0.3/configure
Thread model: single
gcc version 3.0.3

The top-level recursion had far simpler errors and was much faster to
compile (3.21sec vs 5.26sec). The speed results were not affected by
removing the BOOST_STATIC_ASSERT. I will try and see if these results
scale to longer lists.

Hamish

In file included from ../boost/boost/boost/mpl/list.hpp:26,
                 from mpl_test.cpp:3:
../boost/boost/boost/mpl/list/aux_/impl.hpp:32:10: warning: pasting "list20" and "." does not give a valid preprocessing token
mpl_test.cpp: In instantiation of `test_failure::apply<test_failure::apply<test_failure::apply<initial_state, a>::type, a>::type, b>':
../boost/boost/boost/mpl/aux_/fold_op.hpp:36: instantiated from `boost::mpl::apply2<test_failure, test_failure::apply<test_failure::apply<initial_state, a>::type, a>::type, b>'
../boost/boost/boost/mpl/aux_/fold_op.hpp:36: instantiated from `boost::mpl::aux::fold_op<test_failure>::apply<test_failure::apply<test_failure::apply<initial_state, a>::type, a>::type, boost::mpl::list_iterator<boost::mpl::list1<b> > >'
../boost/boost/boost/mpl/aux_/iter_fold_if.hpp:55: instantiated from `boost::mpl::apply2<boost::mpl::aux::fold_op<test_failure>, test_failure::apply<test_failure::apply<initial_state, a>::type, a>::type, boost::mpl::list_iterator<boost::mpl::list1<b> > >'
../boost/boost/boost/mpl/aux_/iter_fold_if.hpp:55: instantiated from `boost::mpl::aux::iter_fold_step_impl<true>::result_<boost::mpl::list_iterator<boost::mpl::list1<b> >, test_failure::apply<test_failure::apply<initial_state, a>::type, a>::type, boost::mpl::aux::fold_op<test_failure>, boost::mpl::next<boost::mpl::list_iterator<boost::mpl::list1<b> > > >'
../boost/boost/boost/mpl/aux_/iter_fold_if.hpp:190: instantiated from `boost::mpl::aux::iter_fold_forward_step<boost::mpl::list_iterator<boost::mpl::list1<b> >, test_failure::apply<test_failure::apply<initial_state, a>::type, a>::type, boost::mpl::aux::fold_op<test_failure>, boost::mpl::aux::fold_pred<boost::mpl::list_iterator<boost::mpl::null_node> >, boost::mpl::bool_c<true> >'
../boost/boost/boost/mpl/aux_/iter_fold_if.hpp:190: instantiated from `boost::mpl::aux::iter_fold_if<boost::mpl::list_iterator<boost::mpl::list3<a, a, b> >, initial_state, boost::mpl::aux::fold_op<test_failure>, boost::mpl::aux::fold_pred<boost::mpl::list_iterator<boost::mpl::null_node> >, boost::mpl::aux::fold_op<boost::mpl::project1st<boost::mpl::_, boost::mpl::_> >, boost::mpl::aux::fold_pred<boost::mpl::list_iterator<boost::mpl::null_node> > >'
../boost/boost/boost/mpl/fold.hpp:55: instantiated from `boost::mpl::fold<boost::mpl::list3<a, a, b>, initial_state, test_failure, boost::mpl::project1st<boost::mpl::_, boost::mpl::_> >'
mpl_test.cpp:45: instantiated from here
mpl_test.cpp:15: `sizeof' applied to incomplete type
   `boost::STATIC_ASSERTION_FAILURE<false>'
Command exited with non-zero status 1
5.26user 0.26system 0:11.53elapsed 47%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (1030major+26185minor)pagefaults 0swaps

In file included from ../boost/boost/boost/mpl/list.hpp:26,
                 from mpl_test.cpp:3:
../boost/boost/boost/mpl/list/aux_/impl.hpp:32:10: warning: pasting "list20" and "." does not give a valid preprocessing token
mpl_test.cpp: In instantiation of `test_failure2<boost::mpl::list_node<b, boost::mpl::null_node> >':
mpl_test.cpp:35: instantiated from `test_failure2<boost::mpl::list_node<a, boost::mpl::list_node<b, boost::mpl::null_node> > >'
mpl_test.cpp:35: instantiated from `test_failure2<boost::mpl::list_node<a, boost::mpl::list_node<a, boost::mpl::list_node<b, boost::mpl::null_node> > > >'
mpl_test.cpp:49: instantiated from here
mpl_test.cpp:34: `sizeof' applied to incomplete type
   `boost::STATIC_ASSERTION_FAILURE<false>'
Command exited with non-zero status 1
3.21user 0.18system 0:07.32elapsed 46%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (1030major+23609minor)pagefaults 0swaps



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk