The comma between double, 2 parsed as part of the macro definition. The solutions are as follows:
Option number 1
typedef boost::multi_array<double, 2> my_name; Q_DECLARE_METATYPE( my_name );
Option number 2
#include <boost/utility/identity_type.hpp> Q_DECLARE_METATYPE( BOOST_IDENTITY_TYPE( (boost::multi_array<double, 2>) ) );
Option number 3
Handwritten BOOST_IDENTITY_TYPE :
template <typename T> struct identity_type; template <typename T> struct identity_type<void(T)> { typedef T type; }; #define IDENTITY_TYPE(T) typename identity_type<void T>::type Q_DECLARE_METATYPE( IDENTITY_TYPE( (boost::multi_array<double, 2>) ) );
Option number 4
Replace the comma with the preprocessor macro:
#define COMMA , Q_DECLARE_METATYPE( boost::multi_array<double COMMA 2> ); #undef COMMA
source share