
Dominique Devienne <ddevienne <at> gmail.com> writes:
On Tue, Jul 14, 2009 at 5:49 PM, JOAQUIN M. LOPEZ MUÑOZ<joaquin <at> tid.es>
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<typename TagList,typename KeyFromValue,typename Compare> struct is_unique_index< boost::multi_index::ordered_unique<TagList,KeyFromValue,Compare>
:boost::mpl::true_{};
template<typename TagList,typename KeyFromValue,typename Hash,typename Pred> struct is_unique_index< boost::multi_index::hashed_unique<TagList,KeyFromValue,Hash,Pred>
:boost::mpl::true_{};
and similarly for ordered vs hashed. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo