mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-21 16:22:45 +02:00
Fix hard compilation error with nested fusion::cons.
This commit is contained in:
@ -27,7 +27,6 @@
|
|||||||
#include <boost/fusion/support/sequence_base.hpp>
|
#include <boost/fusion/support/sequence_base.hpp>
|
||||||
#include <boost/mpl/int.hpp>
|
#include <boost/mpl/int.hpp>
|
||||||
#include <boost/mpl/bool.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
#include <boost/mpl/or.hpp>
|
|
||||||
|
|
||||||
namespace boost { namespace fusion
|
namespace boost { namespace fusion
|
||||||
{
|
{
|
||||||
@ -75,10 +74,7 @@ namespace boost { namespace fusion
|
|||||||
cons(
|
cons(
|
||||||
Sequence const& seq
|
Sequence const& seq
|
||||||
, typename boost::disable_if<
|
, typename boost::disable_if<
|
||||||
mpl::or_<
|
is_convertible<Sequence, Car> // use copy to car instead
|
||||||
is_convertible<Sequence, cons> // use copy ctor instead
|
|
||||||
, is_convertible<Sequence, Car> // use copy to car instead
|
|
||||||
>
|
|
||||||
>::type* /*dummy*/ = 0
|
>::type* /*dummy*/ = 0
|
||||||
)
|
)
|
||||||
: car(*fusion::begin(seq))
|
: car(*fusion::begin(seq))
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <boost/lambda/lambda.hpp>
|
#include <boost/lambda/lambda.hpp>
|
||||||
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
#include <boost/fusion/algorithm/iteration/for_each.hpp>
|
||||||
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
|
#include <boost/fusion/algorithm/transformation/filter_if.hpp>
|
||||||
|
#include <boost/fusion/algorithm/transformation/push_front.hpp>
|
||||||
#include <boost/fusion/sequence/io/out.hpp>
|
#include <boost/fusion/sequence/io/out.hpp>
|
||||||
|
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
@ -83,6 +84,12 @@ main()
|
|||||||
BOOST_TEST((*begin(tie) == 3));
|
BOOST_TEST((*begin(tie) == 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// This used to trigger a hard compilation error:
|
||||||
|
cons<cons<int> > xs;
|
||||||
|
begin(push_front(xs, 3));
|
||||||
|
}
|
||||||
|
|
||||||
return boost::report_errors();
|
return boost::report_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user