On Fri, Jul 17, 2009 at 9:07 AM, Joaquin M Lopez Munoz
Dominique Devienne
writes: On Tue, Jul 14, 2009 at 5:49 PM, JOAQUIN M. LOPEZ MUÑOZ
One last question tonight :)
Sorry it's been a little later than that. I've been offline for the last couple of days.
Similarly to how I can now statically enable/disable code based on which index is implemented by a BMI, can one also change that code based on whether the index is unique vs non-unique? Or ordered vs hashed? [...]
Use index_specifier_type_list instead of index_type_list (differences explained at http://tinyurl.com/nwe27r ) and resort to something like this:
template<typename IndexSpecifier> struct is_unique_index:boost::mpl::false_{};
template
struct is_unique_index< boost::multi_index::ordered_unique >:boost::mpl::true_{}; template
struct is_unique_index< boost::multi_index::hashed_unique >:boost::mpl::true_{}; and similarly for ordered vs hashed.
Thanks. Partial specialization I understand at least :) Although that's the first time I see the specialization having more template arguments than the base template, and that threw me off initially, but I see there's still a single template argument in is_unique_index, which happens to be a template itself. Thanks a bunch. --DD