14template<
typename T,
typename Allocator = std::allocator<std::decay_t<T>>>
15using Buffer = TTG_IMPL_NS::Buffer<T, Allocator>;
21 template<
typename T,
typename A>
25 template<
typename T,
typename A>
30 template<
typename T,
typename A>
42 template<
typename T,
typename Enabler =
void>
59#ifdef TTG_SERIALIZATION_SUPPORTS_MADNESS
60#include <madness/world/buffer_archive.h>
65 struct BufferVisitorArchive :
public madness::archive::BaseOutputArchive {
70 template<
typename _Fn>
71 BufferVisitorArchive(_Fn&& fn)
80 template <
typename T,
typename Allocator>
83 for (std::size_t i = 0; i < n; ++i) {
89 void store(
const T* t,
long n)
const {
94 void open(std::size_t ) {}
104 std::size_t size()
const {
110 template<
typename Fn>
111 BufferVisitorArchive(
Fn&&) -> BufferVisitorArchive<Fn>;
114 template <
typename Fn>
115 struct is_archive<archive::BufferVisitorArchive<Fn>> : std::true_type {};
117 template <
typename Fn>
118 struct is_output_archive<archive::BufferVisitorArchive<Fn>> : std::true_type {};
120 template <
typename Fn,
typename T>
121 struct is_default_serializable_helper<archive::BufferVisitorArchive<Fn>, T,
122 std::enable_if_t<is_trivially_serializable<T>::value>>
125 template <
typename Fn,
typename T,
typename Allocator>
126 struct is_default_serializable_helper<archive::BufferVisitorArchive<Fn>,
ttg::Buffer<T, Allocator>>
131 template<
typename T,
typename Fn>
132 requires(madness::is_serializable_v<madness::archive::BufferVisitorArchive<Fn>, std::decay<T>>)
134 madness::archive::BufferVisitorArchive ar(std::forward<Fn>(fn));
139 using buffer_apply_dummy_fn =
decltype([]<
typename T,
typename A>(
const ttg::Buffer<T, A>&){});
142 struct has_buffer_apply_helper<T,
std::enable_if_t<madness::is_serializable_v<madness::archive::BufferVisitorArchive<buffer_apply_dummy_fn>, std::decay_t<T>>>>
151 template<
typename T,
typename Fn>
constexpr const bool has_buffer_apply_v
void buffer_apply(T &&t, Fn &&fn)
top-level TTG namespace contains runtime-neutral functionality
N.B. contains values of F_n and F_{n-1}.