|
Boost Users : |
Subject: Re: [Boost-users] [multi-index] multi-index type trait
From: Joaquin M Lopez Munoz (joaquin_at_[hidden])
Date: 2015-08-18 04:49:54
Elizabeta <elizabeta.petreska <at> gmail.com> writes:
>
> Hi
> how to test if the first index of boost::multi-index is key based or
> sequence based at compile time[...]
This can do:
#include <boost/multi_index/ordered_index_fwd.hpp>
#include <boost/multi_index/hashed_index_fwd.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/front.hpp>
template<typename Index>
struct is_key_based_index:boost::mpl::false_{};
template<typename... Args>
struct is_key_based_index<
boost::multi_index::ordered_unique<Args...>
>:boost::mpl::true_{};
template<typename... Args>
struct is_key_based_index<
boost::multi_index::ordered_non_unique<Args...>
>:boost::mpl::true_{};
template<typ
µ¸¸¸ÉÌø(ÍÑÉÕÐ¥Í}å}
Í}¥¹àð(½½ÍÐèéµÕ±Ñ¥}¥¹àèé¡
Í¡}Õ¹¥ÅÕñÉ̸¸¸ø(øé½½ÍÐèéµÁ°èéÑÉÕ}íôì((ѵÁ±
ÑñÑåÁ¹
µ¸¸¸ÉÌø(ÍÑÉÕÐ¥Í}å}
Í}¥¹àð(½½ÍÐèéµÕ±Ñ¥}¥¹àèé¡
Í¡}¹½¹}Õ¹¥ÅÕñÉ̸¸¸ø(øé½½ÍÐèéµÁ°èéÑÉÕ}íôì((ѵÁ±
ÑñÑåÁ¹
µ5ձѥ%¹á
½¹Ñ
¥¹Èø(ÍÑÉÕÐ¥Í}¥ÉÍÑ}¥¹á}å}
Íè(¥Í}å}
Í}¥¹àð(ÑåÁ¹
µ½½ÍÐèéµÁ°èéɽ¹Ðð(ÑåÁ¹
µ5ձѥ%¹á
½¹Ñ
¥¹Èè饹á}ÍÁ¥¥É}ÑåÁ}±¥ÍÐ(øèéÑåÁ(ø(íôì()Õ±°á
µÁ±
СÑÑÀè¼½½±¥ÉÔ¹ÍÑ
µÉ½½¹½´½¼äÌÙ
ÄÀÐÄØÈÀÈÕ())½
Å×µ¸43ÍÁè5׎è)Q±Í¹¥
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net