Boost logo

Boost Users :

Subject: Re: [Boost-users] Why fusion::map<> types not the same?
From: TONGARI J (tongari95_at_[hidden])
Date: 2013-09-03 06:09:35


2013/9/3 niXman <i.nixman_at_[hidden]>

> Hi,
>
> Why 'type' is not same as 'expected' in the example below?
>

Because 'push_back' returns you a 'view'.

> using origin = boost::fusion::map<
> boost::fusion::pair<int, int>
> >;
> using expected = boost::fusion::map<
> boost::fusion::pair<int, int>
> ,boost::fusion::pair<char, char>
> >;
>
> using type = boost::fusion::result_of::push_back<
> origin
> ,boost::fusion::pair<char, char>
> >::type;
>
> static_assert(std::is_same<expected, type>::value, "error!");
>
>
> The second question is, how can I get the same type as 'expected' when
> using 'result_of::push_back<>::type' ?
>

Try 'as_map'

HTH



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