#pragma once #include #include "chat_messages.hpp" /* SFINAE compile-type checker for receive policies (as defined in chat_networking.hpp) * it checks whether PolicyCandidate supplies all of the following methods: * - static void message_do_what(chat_message) * - static void handshake_do_what(chat_message) * - static void serverdirection_do_what(chat_message) * - static void login_do_what(chat_message) * - static void logout_do_what(chat_message) */ template struct is_valid_receive_policy : std::false_type {}; template struct is_valid_receive_policy< PolicyCandidate, typename std::enable_if< std::is_same< decltype(PolicyCandidate ::message_do_what(std::declval())), void >::value && std::is_same< decltype(PolicyCandidate ::handshake_do_what(std::declval())), void >::value && std::is_same< decltype(PolicyCandidate ::serverdirection_do_what(std::declval())), void >::value && std::is_same< decltype(PolicyCandidate ::login_do_what(std::declval())), void >::value && std::is_same< decltype(PolicyCandidate ::logout_do_what(std::declval())), void >::value >::type> : std::true_type {}; /* SFINAE compile-type checker for send policies (as defined in chat_networking.hpp) * it checks whether PolicyCandidate supplies all of the following methods: * - static bool check_msg_length(chat_message) */ template struct is_valid_send_policy : std::false_type {}; template struct is_valid_send_policy< PolicyCandidate, typename std::enable_if< std::is_same< decltype(PolicyCandidate ::check_msg_length(std::declval())), bool >::value >::type> : std::true_type {};