Boost logo

Boost Users :

Subject: Re: [Boost-users] [fusion] push_back / pop_back
From: Christopher Schmidt (mr.chr.schmidt_at_[hidden])
Date: 2011-10-25 10:31:50


Daniel Bradburn <moagstar_at_[hidden]> writes:

> Hi,
>
> I am trying to do the following:
>
> #include <string>#include <boost/fusion/tuple.hpp>#include
> <boost/fusion/include/push_back.hpp>#include
> <boost/fusion/include/pop_back.hpp>
> int main(int argc, char* argv[])
> {
> typedef boost::fusion::tuple<int> T1;
> typedef boost::fusion::result_of::push_back<const T1, std::string>::type T2;
>
> T1 a(0);
> T2 b(boost::fusion::push_back(a, std::string("")));
>
> boost::fusion::get<0>();

fusion::joint_view, which is returned by fusion::push_back, does not
implement the random access concept. Use fusion::front or fusion::deref
x fusion::begin.

>
> T1 c(boost::fusion::pop_back(b));

fusion::pop_back requires the sequence to be bidirectional.
fusion::joint_view isn't.

> return 0;
>
> }
>

[...]

        Christopher


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