Hello,
Fusion provides adaptation code for treating an std::tuple
as a Fusion sequence, and adaptation code for treating
Fusion sequences as MPL sequences, but it seems that in
the case of a binary mpl::transform on an empty std::tuple,
the two do not work well together.
When trying to compile the following code:
#include
#include
#include
#include
#include
#include
struct first
{
template
struct apply
{
typedef T type;
};
};
int main()
{
typedef std::tuple<> fusion_sequence1_type;
typedef std::tuple<> fusion_sequence2_type;
typedef boost::mpl::transform>
>::type result_type;
}
I get the following errors:
In file included from test.cpp:4:
In file included from boost/fusion/adapted/std_tuple.hpp:13:
In file included from boost/fusion/adapted/std_tuple/detail/begin_impl.hpp:10:
boost/fusion/adapted/std_tuple/std_tuple_iterator.hpp:45:13: error: implicit instantiation of undefined template 'std::tuple_element<0, std::tuple<> >'
: std::tuple_element, 0>::value_of, 0> >' requested here
struct apply : Iterator::template value_of<Iterator> {};
^
boost/fusion/iterator/value_of.hpp:51:15: note: in instantiation of template class 'boost::fusion::extension::value_of_implboost::fusion::iterator_facade_tag::apply, 0> >' requested here
: extension::value_of_impl::
^
boost/fusion/iterator/mpl/fusion_iterator.hpp:46:45: note: in instantiation of template class 'boost::fusion::result_of::value_of, 0> >' requested here
typedef typename fusion::result_of::value_of<Iterator>::type type;
^
boost/mpl/iterator_category.hpp:27:22: note: in instantiation of template class 'boost::mpl::fusion_iterator, 0> >' requested here
typedef typename Iterator::category type;
^
boost/mpl/pair_view.hpp:152:20: note: in instantiation of template class 'boost::mpl::iterator_category, 0> > >' requested here
typename iterator_category::type
^
boost/mpl/aux_/has_tag.hpp:20:1: note: (skipping 5 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_tag, tag, false)
^
boost/mpl/has_xxx.hpp:244:65: note: expanded from macro 'BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF'
, boost::mpl::aux::type_wrapper* = 0 \
^
boost/mpl/transform.hpp:75:7: note: in instantiation of template class 'boost::mpl::fold, std::tuple<> >, boost::mpl::vector, boost::mpl::bind2, mpl_::arg<1>, boost::mpl::bind2, mpl_::arg<2> >, boost::mpl::bind1, mpl_::arg<2> > > > >' requested here
: fold<
^
boost/mpl/transform.hpp:114:1: note: in instantiation of template class 'boost::mpl::aux::transform2_impl, std::tuple<>, first, boost::mpl::back_inserter > >' requested here
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, transform2)
^
boost/mpl/aux_/inserter_algorithm.hpp:44:7: note: expanded from macro 'BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF'
: aux::name##_impl \
^
boost/mpl/eval_if.hpp:38:22: note: in instantiation of template class 'boost::mpl::transform2, std::tuple<>, first, boost::mpl::back_inserter > >' requested here
typedef typename f_::type type;
^
boost/mpl/transform.hpp:138:1: note: in instantiation of template class 'boost::mpl::eval_if >, boost::mpl::not_ > >, mpl_::bool_<false>, mpl_::bool_<false> >, boost::mpl::transform1, std::tuple<>, first>, boost::mpl::transform2, std::tuple<>, first, boost::mpl::back_inserter > > >' requested here
AUX778076_TRANSFORM_DEF(transform)
^
boost/mpl/transform.hpp:125:22: note: expanded from macro 'AUX778076_TRANSFORM_DEF'
typedef typename eval_if< \
^
test.cpp:21:25: note: in instantiation of template class 'boost::mpl::transform, std::tuple<>, first, boost::mpl::back_inserter > >' requested here
typedef boost::mpl::transform