[boost] [mpl] [bimap] BOOST_MPL_LIMIT_METAFUNCTION_ARITY issue on g++ 4.6.3 and boost 1.50

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[boost] [mpl] [bimap] BOOST_MPL_LIMIT_METAFUNCTION_ARITY issue on g++ 4.6.3 and boost 1.50

Adam Lach
Hi,

I have already asked for help on Boost.users, but with no luck,  see here.

Since then I have managed to reproduce this problem in a simpler case:

#define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 10

#include <boost/mpl/inherit.hpp>
#include <boost/bimap.hpp>

struct S0 {};
struct S1 {};
struct S2 {};
struct S3 {};
struct S4 {};
struct S5 {};

template<typename T0, typename T1, typename T2, typename T3, typename T4,
typename T5>
struct example : boost::mpl::inherit<T0,T1,T2,T3,T4,T5> {};

int main() {
         example<S0,S1,S2,S3,S4,S5> pasta;
         return 0;
}

The weird thing is that it occurs only if bimap.hpp is included. Please help.

Thank you in advance,
Adam Lach
Reply | Threaded
Open this post in threaded view
|

Re: [mpl] [bimap] BOOST_MPL_LIMIT_METAFUNCTION_ARITY issue on g++ 4.6.3 and boost 1.50

Matias Capeletto
Hi Adam,

If you check the include chain you will notice that Bimap is including
boost/mpl/lambda.hpp through the lib dependencies.

Your example can be reduced to this:

  #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  #define BOOST_MPL_LIMIT_METAFUNCTION_ARITY 9

  #include <boost/mpl/lambda.hpp>

  int main() {
      return 0;
  }

That fails for me with GCC 4.7.2 and Boost 1.52.

It seems that you are hitting the compiler limits. It works if you use
8 as the limit. You can open a ticket in Trac for MPL devs to look
into the issue.

Best regards
Matias

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [mpl] [bimap] BOOST_MPL_LIMIT_METAFUNCTION_ARITY issue on g++ 4.6.3 and boost 1.50

Adam Lach
Hi Matias,

Thank you for such a quick answer. I will follow your advice and open a ticket.

About compiler limitations. Visual compiler (VS 2010) does not seem to have any problems even with BOOST_MPL_LIMIT_METAFUNCTION_ARITY == 100. Would it be possible that there is such a huge difference in capabilities between cl and g++?

Best Regards,
Adam