Boost logo

Boost Users :

Subject: [Boost-users] [fusion]push_back<list<>,int> > fails compilation
From: Larry Evans (cppljevans_at_[hidden])
Date: 2010-07-16 03:18:09


The code in the 1st attachment fails to compile as shown in
2nd attachment. If that's intended, the what's the justification
for not allowing appending to an empty sequence? If that's
not intended, then should I file a bug report?

Based on:

<fusion.doc>/html/fusion/algorithm/transformation/functions/push_back.html

it seems push_back should work on a 'Forward Sequence' and
based on:

<fusion.doc>/html/fusion/container/list.html

list is a 'Forward Sequence'. And based on the following quote from
the Synopsis of the list.html:

> The variadic class interface accepts 0 to FUSION_MAX_LIST_SIZE elements

an empty list type, i.e. list<>, is a list, the attached code should
compile.

-regards
Larry


###-*- mode: compilation; default-directory: "~/prog_dev/boost-svn/ro/trunk/libs/fusion/sandbox/" -*-
Compilation started at Fri Jul 16 02:08:38

make HOW=gcc4_5n run
install -d `dirname /home/evansl/prog_dev/boost-svn/ro/trunk/sandbox-local/build/gcc4_5n/boost-svn/ro/trunk/libs/fusion/sandbox/list_push_back.o`
/home/evansl/download/gcc/4.5-20100624/install/bin/g++ -c -Wall -ftemplate-depth-300 -O0 -g3 -fno-inline -std=gnu++0x -I/home/evansl/prog_dev/boost-svn/ro/trunk -DTEMPLATE_DEPTH=300 list_push_back.cpp -MMD -o /home/evansl/prog_dev/boost-svn/ro/trunk/sandbox-local/build/gcc4_5n/boost-svn/ro/trunk/libs/fusion/sandbox/list_push_back.o
list_push_back.cpp: In function 'void boost::fusion::sandbox::run()':
list_push_back.cpp:25:45: error: no matching function for call to 'boost::fusion::joint_view<boost::fusion::list<>, const boost::fusion::single_view<int> >::joint_view(boost::fusion::result_of::push_back<const boost::fusion::list<>, int>::type)'
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/fusion/view/joint_view/joint_view.hpp:55:9: note: candidates are: boost::fusion::joint_view<Sequence1, Sequence2>::joint_view(Sequence1&, Sequence2&) [with Sequence1 = boost::fusion::list<>, Sequence2 = const boost::fusion::single_view<int>]
/home/evansl/prog_dev/boost-svn/ro/trunk/boost/fusion/view/joint_view/joint_view.hpp:34:5: note: boost::fusion::joint_view<boost::fusion::list<>, const boost::fusion::single_view<int> >::joint_view(const boost::fusion::joint_view<boost::fusion::list<>, const boost::fusion::single_view<int> >&)
make: *** [/home/evansl/prog_dev/boost-svn/ro/trunk/sandbox-local/build/gcc4_5n/boost-svn/ro/trunk/libs/fusion/sandbox/list_push_back.o] Error 1

Compilation exited abnormally with code 2 at Fri Jul 16 02:08:40



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net