23 #ifndef GRAPHLAB_SCHEDULER_GET_MESSAGE_PRIORITY_HPP
24 #define GRAPHLAB_SCHEDULER_GET_MESSAGE_PRIORITY_HPP
26 #include <boost/type_traits.hpp>
31 namespace scheduler_impl {
34 struct implements_priority_member {
35 template<
typename U,
double (U::*)() const>
struct SFINAE {};
36 template <
typename U>
static char test(SFINAE<U, &U::priority>*);
37 template <
typename U>
static int test(...);
38 static const bool value = (
sizeof(test<T>(0)) ==
sizeof(char));
41 template <
typename MessageType>
42 typename boost::enable_if_c<implements_priority_member<MessageType>::value,
44 get_message_priority(
const MessageType &m) {
48 template <
typename MessageType>
49 typename boost::disable_if_c<implements_priority_member<MessageType>::value,
51 get_message_priority(
const MessageType &m) {