Why fusion::map<> types not the same?
Hi, Why 'type' is not same as 'expected' in the example below? 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' ? -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/
2013/9/3 niXman <i.nixman@gmail.com>
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
2013/9/3 TONGARI J:
Try 'as_map'
Thanks, it works! -- Regards, niXman ___________________________________________________ Dual-target(32 & 64-bit) MinGW compilers for 32 and 64-bit Windows: http://sourceforge.net/projects/mingwbuilds/ ___________________________________________________ Another online IDE: http://liveworkspace.org/
participants (2)
-
niXman
-
TONGARI J