> > case MAX_WITCH: > > visitor( Typelist[MAX_WITCH](storage) ); > > break; > > } > > } > > Your pseudo-code is misleading. There is no "MAX_WHICH" available to the > preprocessor when MPL-sequences are given because there is no theoretical > upper limit on the size of a type-sequence.
1. There is "theoretical" limits for the size of MPL sequences. See MPL docs (BOOST_MPL_LIMIT_LIST_SIZE for list) 2. You could limit variant support only for lists that does not exceed your own limit BOOST_VARIANT_LIMIT_TYPES. 3. You could choose/define any other arbitrary limit (it should probably exceed limits mentioned in items 1 and 2) All you need once you chose the limit is to add default clause to above switch statement with static assert in it. So I believe my code is perfectly implementable. Gennadiy. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost