9 #ifndef FAIR_MQ_SDK_TRAITS_H 10 #define FAIR_MQ_SDK_TRAITS_H 12 #include <asio/associated_allocator.hpp> 13 #include <asio/associated_executor.hpp> 14 #include <type_traits> 20 template<
typename T,
typename Executor>
21 struct associated_executor_impl<T,
23 std::enable_if_t<is_executor<typename T::ExecutorType>::value>>
25 using type =
typename T::ExecutorType;
27 static auto get(
const T& obj,
const Executor& ) noexcept -> type
29 return obj.GetExecutor();
34 template<
typename T,
typename Allocator>
35 struct associated_allocator_impl<T,
37 std::enable_if_t<T::AllocatorType>>
39 using type =
typename T::AllocatorType;
41 static auto get(
const T& obj,
const Allocator& ) noexcept -> type
43 return obj.GetAllocator();