Hi there, I'm experiencing problems when setting FUSION_MAX_MAP_SIZE to 20. I'm getting a lot of compiler errors: #define FUSION_MAX_MAP_SIZE 20 #include <string> #include <boost/static_assert.hpp> #include <boost/fusion/sequence.hpp> using namespace std; using namespace boost; // Address contact namespace address_fields { struct _address_1_; struct _address_2_; struct _city_; struct _state_; struct _zip_; struct _country_; struct _phone_1_; struct _phone_2_; struct _email_1_; struct _email_2_; struct _fax_; struct _other_; } typedef fusion::map< fusion::pair< address_fields::_address_1_, string > , fusion::pair< address_fields::_address_2_, string > , fusion::pair< address_fields::_city_ , string > , fusion::pair< address_fields::_state_ , string > , fusion::pair< address_fields::_zip_ , string > , fusion::pair< address_fields::_country_ , string > , fusion::pair< address_fields::_phone_1_ , string > , fusion::pair< address_fields::_phone_2_ , string > , fusion::pair< address_fields::_email_1_ , string > , fusion::pair< address_fields::_email_2_ , string > , fusion::pair< address_fields::_fax_ , string > , fusion::pair< address_fields::_other_ , string > > address_type; int _tmain(int argc, _TCHAR* argv[]) { return 0; } c:\boost\boost\fusion\sequence\container\map\map.hpp(41) : error C2977: 'boost::fusion::vector' : too many template arguments c:\boost\boost\fusion\sequence\container\vector\vector.hpp(126) : see declaration of 'boost::fusion::vector' c:\boost\boost\fusion\sequence\container\map\map.hpp(70) : see reference to class template instantiation 'boost::fusion::map<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>' being compiled c:\boost\boost\fusion\sequence\container\map\detail\map_lookup.hpp(31) : error C3203: 'vector' : class template invalid as template argument for template parameter 'Vector', expected a real type c:\boost\boost\fusion\sequence\container\map\detail\map_lookup.hpp(32) : see reference to class template instantiation 'boost::fusion::map<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19>::meta_find_impl<Key,dummy>' being compiled c:\boost\boost\fusion\sequence\container\map\detail\map_lookup.hpp(37) : error C3203: 'vector' : class template invalid as template argument for template parameter 'Vector', expected a real type [snip] Any ideas, Christian
Aha, you need to set FUSION_MAX_VECTOR_SIZE, as well. Must have overlooked that in the documentation. This works now: #define FUSION_MAX_VECTOR_SIZE 20 #define FUSION_MAX_MAP_SIZE 20 #include <string> #include <boost/static_assert.hpp> #include <boost/fusion/sequence.hpp> using namespace std; using namespace boost; // Address contact namespace address_fields { struct _address_1_; struct _address_2_; struct _city_; struct _state_; struct _zip_; struct _country_; struct _phone_1_; struct _phone_2_; struct _email_1_; struct _email_2_; struct _fax_; struct _other_; } typedef fusion::map< fusion::pair< address_fields::_address_1_, string > , fusion::pair< address_fields::_address_2_, string > , fusion::pair< address_fields::_city_ , string > , fusion::pair< address_fields::_state_ , string > , fusion::pair< address_fields::_zip_ , string > , fusion::pair< address_fields::_country_ , string > , fusion::pair< address_fields::_phone_1_ , string > , fusion::pair< address_fields::_phone_2_ , string > , fusion::pair< address_fields::_email_1_ , string > , fusion::pair< address_fields::_email_2_ , string > , fusion::pair< address_fields::_fax_ , string > , fusion::pair< address_fields::_other_ , string > > address_type; int _tmain(int argc, _TCHAR* argv[]) { return 0; } Cool. I can proceed coding now. Christian
Christian Henning wrote:
Hi there, I'm experiencing problems when setting FUSION_MAX_MAP_SIZE to 20. I'm getting a lot of compiler errors:
#define FUSION_MAX_MAP_SIZE 20
Aha, you need to set FUSION_MAX_VECTOR_SIZE, as well. Must have overlooked that in the documentation.
Looks like a usability problem. We'll look into it. Setting FUSION_MAX_MAP_SIZE should be enough. Added to the Todo list. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Christian Henning
-
Joel de Guzman