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>
16 namespace asio::detail {
19 template<
typename T,
typename Executor>
20 struct associated_executor_impl<T,
22 std::enable_if_t<is_executor<typename T::ExecutorType>::value>>
24 using type =
typename T::ExecutorType;
26 static auto get(
const T& obj,
const Executor& ) noexcept -> type
28 return obj.GetExecutor();
33 template<
typename T,
typename Allocator>
34 struct associated_allocator_impl<T,
36 std::enable_if_t<T::AllocatorType>>
38 using type =
typename T::AllocatorType;
40 static auto get(
const T& obj,
const Allocator& ) noexcept -> type
42 return obj.GetAllocator();