[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    [Boost-users] [fusion] problem converting the result of a transform of a set into a map
From:       Christian Kerl <christian.kerl () in ! tum ! de>
Date:       2014-09-26 15:10:13
Message-ID: 542581D5.30504 () in ! tum ! de
[Download RAW message or body]

Hello everybody,

I've a problem with the boost fusion library. I try to convert a fusion =

set into a map using the transform algorithm.

Here is a example:

typedef typename boost::fusion::result_of::as_map<
typename boost::fusion::result_of::transform<BoundMembers, =

map_name_to_member>::type
 >::type Content;

where BoundMembers is a boost::fusion::set and map_name_to_member is =

defined as:

struct map_name_to_member
{
template <typename T>
struct result;

template <class F, typename T>
struct result<F(T)>
{
typedef boost::fusion::pair<typename T::Name, typename T::Member> type;
};
};

With boost 1.56 and gcc 4.8.1 I get the following compilation error:

include/boost/fusion/iterator/key_of.hpp:36:16: error: invalid use of =

incomplete type =91struct =

boost::fusion::extension::key_of_impl<boost::fusion::transform_view_iterato=
r_tag>=92
struct key_of
^
include/boost/fusion/iterator/key_of.hpp:21:16: error: declaration of =

=91struct =

boost::fusion::extension::key_of_impl<boost::fusion::transform_view_iterato=
r_tag>=92
struct key_of_impl;

However, this code used to work with Boost 1.48. I found a workaround to =

fix this, by converting the result of transform to a fusion list before =

coverting it to a map, i.e.:

typedef typename boost::fusion::result_of::as_map<
typename boost::fusion::result_of::as_list<
typename boost::fusion::result_of::transform<BoundMembers, =

internal::map_name_to_member>::type
 >::type
 >::type Content;

Am I doing something wrong or is this intended behavior? Thanks for your =

support.

Best regards,
Christian Kerl
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic