patches from tongari: allow custom Associative Sequence which doesn't have fusion::pair

as elements.

[SVN r83455]
This commit is contained in:
Joel de Guzman
2013-03-16 07:28:23 +00:00
parent d354c5183b
commit b36426c8e3
10 changed files with 823 additions and 774 deletions

View File

@@ -18,12 +18,13 @@
namespace boost { namespace fusion { namespace detail
{
template <typename First, typename Last
, bool is_empty = result_of::equal_to<First, Last>::value>
template <typename First, typename Last, bool is_assoc
, bool is_empty = result_of::equal_to<First, Last>::value
>
struct build_map;
template <typename First, typename Last>
struct build_map<First, Last, true>
template <typename First, typename Last, bool is_assoc>
struct build_map<First, Last, is_assoc, true>
{
typedef map<> type;
static type
@@ -48,15 +49,15 @@ namespace boost { namespace fusion { namespace detail
}
};
template <typename First, typename Last>
struct build_map<First, Last, false>
template <typename First, typename Last, bool is_assoc>
struct build_map<First, Last, is_assoc, false>
{
typedef
build_map<typename result_of::next<First>::type, Last>
build_map<typename result_of::next<First>::type, Last, is_assoc>
next_build_map;
typedef push_front_map<
typename result_of::value_of<First>::type
typename pair_from<First, is_assoc>::type
, typename next_build_map::type>
push_front;
@@ -65,9 +66,9 @@ namespace boost { namespace fusion { namespace detail
static type
call(First const& f, Last const& l)
{
typename result_of::value_of<First>::type v = *f;
return push_front::call(
v, next_build_map::call(fusion::next(f), l));
pair_from<First, is_assoc>::call(f)
, next_build_map::call(fusion::next(f), l));
}
};
}}}