
On Tue, Feb 10, 2009 at 8:10 PM, Joel de Guzman <joel@boost-consulting.com> wrote:
Stjepan Rajko wrote:
Hi,
I tried to make boost::array a conforming MPL sequence by including:
#include <boost/fusion/adapted/array.hpp> // makes array a conforming fusion sequence #include <boost/fusion/mpl.hpp> // makes fusion sequences conforming MPL sequences
but,
typedef boost::array<int, 1> array; assert(boost::mpl::is_sequence<array>::type::value); // fails
Am I misinterpreting the fusion documentation in expecting that this should work? Is there another way of making boost::array an mpl sequence?
I think the basic problem is that is_sequence is not really part of the requirements for an MPL sequence. You don't have to be a conforming MPL sequences. I am not sure how to best approach this. Perhaps the MPL authors have a better idea?
Joel, thanks for your response. My original problem was with a simple application of mpl::transform, which produced an error stating: no class template named 'apply' in 'struct boost::mpl::clear_impl<boost::mpl::non_sequence_tag> The above code was just an attempt at a minimal example. Also, the same above code passes if boost::array<int, 1> is replaced with fusion::vector<int>, so my impression is that there is something happening for fusion-proper sequences that is not happening for the adapted array. I can provide a minimal example that involves mpl::transform if that is helpful, but I imagine (perhaps erroneously) that whatever fixes mpl::is_sequence would also fix my problem with mpl::transform. Stjepan