HALDLS
is_read_and_writable.h
Go to the documentation of this file.
1 #pragma once
2 #include "fisch/vx/container_cast.h"
3 #include "fisch/vx/traits.h"
4 #include "haldls/vx/traits.h"
5 #include "hate/type_list.h"
6 #include <array>
7 #include <type_traits>
8 
9 namespace haldls::vx::detail {
10 
14 template <typename TL>
16 
17 template <typename... Ts>
18 struct gen_is_read_and_writeable_lookup_table<hate::type_list<Ts...>>
19 {
20  constexpr static std::array<bool, sizeof...(Ts)> value = {
21  (fisch::vx::IsReadable<decltype(fisch::vx::container_cast(std::declval<Ts>()))>::value &&
22  fisch::vx::IsWritable<decltype(fisch::vx::container_cast(std::declval<Ts>()))>::value)...};
23 };
24 
30 constexpr bool is_read_and_writeable(Backend const b)
31 {
32  constexpr auto lookup_table =
34  return lookup_table[static_cast<size_t>(b)];
35 }
36 
37 } // namespace haldls::vx::detail
constexpr bool is_read_and_writeable(Backend const b)
Get whether given backend container is readable and writable.
Backend
Possible backends to target with PlaybackProgramBuilder::read/write.
Definition: traits.h:23
Generate lookup table from backend to readable and writable property.