Opened 7 years ago

Closed 7 years ago

#11267 closed Bugs (fixed)

Nested boost::fusion::make_list fails to compile under boost 1.58.0

Reported by: Andrew King <eurokang@…> Owned by: Joel de Guzman
Milestone: Boost 1.59.0 Component: fusion
Version: Boost 1.58.0 Severity: Regression
Keywords: Cc:

Description

The following code compiles just fine under boost 1.56.0 (std=c++11), but fails to compile under boost-1.58.0 with either clang++-3.6 or g++-4.9.2

#include <boost/fusion/container/generation/make_list.hpp>
#include <boost/fusion/algorithm/iteration/for_each.hpp>
#include <iostream>

template <typename T>
void Handle(const T& t);

template <typename ... T>
void Handle(const boost::fusion::list<T...>& x);

struct CallFunctor
{
    template <typename T>
    void operator()(const T& t) const
    {
        Handle(t);
    }
};

template <typename T>
void Handle(const T& t)
{
    std::cout << t << std::endl;
}

template <typename ... T>
void Handle(const boost::fusion::list<T...>& x)
{
    boost::fusion::for_each(x, CallFunctor{});
}

template <typename List>
void PrintList(const List& list)
{
    boost::fusion::for_each(list, CallFunctor{});
}

int main()
{
    PrintList(
        boost::fusion::make_list(
            std::string("x"),
            4,
            6,
            boost::fusion::make_list(23.0, std::string("rar"))));

    return 0;
}

There appears to be a compile error with the use of boost::is_convertible inside boost::enable_if in boost/fusion/container/list/cons.hpp:79

Change History (3)

comment:1 by Kohei Takahashi <flast@…>, 7 years ago

Reduced.

#include <boost/fusion/container/generation/make_list.hpp>

int main()
{
    boost::fusion::make_list(boost::fusion::make_list(42));
}

and it relates to constexpr ctor since compiles with -DBOOST_NO_CXX11_CONSTEXPR.

comment:2 by Kohei Takahashi <flast@…>, 7 years ago

Milestone: To Be DeterminedBoost 1.59.0

comment:3 by Joel de Guzman, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.