32#ifndef MADNESS_WORLD_ARCHIVE_H__INCLUDED
33#define MADNESS_WORLD_ARCHIVE_H__INCLUDED
57#include <madness/config.h>
63#define ARCHIVE_COOKIE "archive"
66#define ARCHIVE_MAJOR_VERSION 0
68#define ARCHIVE_MINOR_VERSION 1
73#ifdef MAD_ARCHIVE_DEBUG_ENABLE
74#define MAD_ARCHIVE_DEBUG(s) s
77#define MAD_ARCHIVE_DEBUG(s)
83 template <
typename T>
class Tensor;
115 template <
typename T>
124 template <
typename T>
135#define ARCHIVE_REGISTER_TYPE(T, cooky) \
137 struct archive_typeinfo< T > { \
138 static const unsigned char cookie = cooky; \
146#define ARCHIVE_REGISTER_TYPE_AND_PTR(T, cooky) \
147 ARCHIVE_REGISTER_TYPE(T, cooky); \
148 ARCHIVE_REGISTER_TYPE(T*, cooky+64)
152#define ATN ::madness::archive::archive_type_names
154#define ATI ::madness::archive::archive_typeinfo
160#define ARCHIVE_REGISTER_TYPE_NAME(T) \
161 if (strcmp( ATN[ATI< T >::cookie], "invalid") ) { \
162 std::cout << "archive_register_type_name: slot/cookie already in use! " << #T << " " << ATN[ATI< T >::cookie] << std::endl; \
163 MADNESS_EXCEPTION("archive_register_type_name: slot/cookie already in use!", 0); \
165 ATN[ATI< T >::cookie] = #T
171#define ARCHIVE_REGISTER_TYPE_AND_PTR_NAMES(T) \
172 ARCHIVE_REGISTER_TYPE_NAME(T); \
173 ARCHIVE_REGISTER_TYPE_NAME(T*)
177#ifndef DOXYGEN_SHOULD_SKIP_THIS
241#if __cplusplus >= 201703L
244 (std::is_function<T>::value) {
245 static_assert(
sizeof(std::ptrdiff_t) ==
sizeof(
T*));
249#if __cplusplus >= 201703L
250 static_assert(
sizeof(std::ptrdiff_t) ==
sizeof(
T));
262#if MADNESS_CXX_ABI == MADNESS_CXX_ABI_GenericItanium || MADNESS_CXX_ABI == MADNESS_CXX_ABI_GenericARM
263 static_assert(
sizeof(
T) %
sizeof(
ptrdiff_t) == 0);
265#elif MADNESS_CXX_ABI == MADNESS_CXX_ABI_Microsoft
271 static_assert(
sizeof(
T) %
sizeof(
ptrdiff_t) == 0);
276 std::memcpy(&result, &fn,
sizeof(
result_t));
282#if MADNESS_CXX_ABI == MADNESS_CXX_ABI_GenericItanium
284 if (result[0] == 0) {
285 result[1] = std::numeric_limits<std::ptrdiff_t>::min();
287 else if ((result[0] & 1) == 0) {
290#elif MADNESS_CXX_ABI == MADNESS_CXX_ABI_GenericARM
292 const auto even_adj = (result[1] & 1) == 0;
294 if (result[0] == 0) {
295 result[0] = std::numeric_limits<std::ptrdiff_t>::min();
301#elif MADNESS_CXX_ABI == MADNESS_CXX_ABI_Microsoft
304#warning "Support for serializing member function pointers in Microsoft ABI is not complete"
314 template <
typename T,
typename = std::enable_if_t<is_function_po
inter_v<T>>>
316 static_assert(
sizeof(std::ptrdiff_t) ==
sizeof(
T));
325 template <
typename T, std::
size_t N,
typename = std::enable_if_t<std::is_member_function_po
inter<std::remove_reference_t<T>>::value>>
328#if MADNESS_CXX_ABI == MADNESS_CXX_ABI_GenericItanium
335#elif MADNESS_CXX_ABI == MADNESS_CXX_ABI_GenericARM
338 if (
rel_fn_ptr[0] == std::numeric_limits<std::ptrdiff_t>::min()) {
345#elif MADNESS_CXX_ABI == MADNESS_CXX_ABI_Microsoft
347 using result_t = std::remove_reference_t<T>;
399 template <
class Archive,
class T>
400 typename std::enable_if_t< is_output_archive<Archive>::value &&
406 std::vector<std::ptrdiff_t>
t_rel(n);
407 std::transform(t, t+n, begin(
t_rel), [](
auto&
fn_ptr) {
410 ar.store(
t_rel.data(), n);
413 template <
class Archive,
class T>
414 typename std::enable_if_t< is_output_archive<Archive>::value &&
416 std::is_member_function_pointer<T>::value,
void>
422 std::vector<rel_memfn_ptr_t>
t_rel(n);
423 std::transform(t, t+n, begin(
t_rel), [](
auto&
fn_ptr) {
429 template <
class Archive,
class T>
430 typename std::enable_if_t< is_output_archive<Archive>::value &&
449 template <
class Archive,
class T>
450 typename std::enable_if_t< is_input_archive<Archive>::value &&
456 std::vector<std::ptrdiff_t>
t_rel(n);
457 ar.load(
t_rel.data(),n);
463 template <
class Archive,
class T>
464 typename std::enable_if_t< is_input_archive<Archive>::value &&
466 std::is_member_function_pointer<T>::value,
void>
472 std::vector<rel_memfn_ptr_t>
t_rel(n);
479 template <
class Archive,
class T>
496 template <
class Archive,
class T>
500 for (
unsigned int i=0; i<n; ++i)
509 template <
class Archive,
class T>
516 unsigned char cookie;
521 std::snprintf(msg,
bufsize,
"InputArchive type mismatch: expected cookie "
522 "%u (%s) but got %u (%s) instead",
525 std::cerr << msg << std::endl;
554 template <
class Archive,
class T,
typename Enabler>
560 template <
typename A = Archive,
typename U = T,
typename = std::enable_if_t<has_member_serialize_v<U,A>>>
581 template <
class Archive,
class T>
585 MAD_ARCHIVE_DEBUG(std::cout <<
"default_serialize(ar,t) -> default_serialize(ar,&t,1)" << std::endl);
598 template <
class Archive,
class T>
602 MAD_ARCHIVE_DEBUG(std::cout <<
"serialize(ar,t) -> ArchiveSerializeImpl" << std::endl);
611 template <
class Archive,
class T,
typename Enabler>
614 template <
typename A = Archive,
typename U = T>
615 static inline std::enable_if_t<is_output_archive_v<A> &&
616 !std::is_function<U>::value &&
644 template <
typename A =
Archive,
typename U =
T,
645 typename = std::enable_if_t<is_output_archive_v<A> &&
646 std::is_function<U>::value>>
650 std::add_pointer_t<U>
fn_ptr = &t;
666 template <
class Archive,
class T,
typename Enabler>
674 typename = std::enable_if_t<is_input_archive_v<A> &&
679 static inline void load(
const A& ar,
const U& t) {
701 template <
typename A =
Archive,
typename U =
T,
702 typename = std::enable_if_t<is_input_archive_v<A> &&
703 std::is_function<U>::value>>
707 std::add_pointer_t<U>
fn_ptr;
726 template <
class Archive,
class T,
typename Enabler>
733 template <
typename A = Archive,
typename = std::enable_if_t<is_output_archive_v<A> && has_nonmember_store_v<T,Archive>>>
747 template <
typename A = Archive,
typename = std::enable_if_t<is_input_archive_v<A> && has_nonmember_load_v<T,Archive>>>
766 template <
class Archive,
class T>
768 std::enable_if_t<is_output_archive_v<Archive>,
const Archive&>
773 static_assert(
T_is_serializable,
"T is neither trivially serializable not provided serialization methods");
787 template <
class Archive,
class T>
789 std::enable_if_t<is_input_archive_v<Archive>,
const Archive&>
794 static_assert(
T_is_serializable,
"T is neither trivially serializable not provided serialization methods");
808 template <
class Archive,
class T>
810 std::enable_if_t<is_output_archive_v<Archive>,
const Archive&>
815 static_assert(
T_is_serializable,
"T is neither trivially serializable not provided serialization methods");
829 template <
class Archive,
class T>
831 std::enable_if_t<is_input_archive_v<Archive>,
const Archive&>
836 static_assert(
T_is_serializable,
"T is neither trivially serializable not provided serialization methods");
872 template <
class Archive>
957 template <
typename A = Archive>
958 static inline std::enable_if_t<!is_output_archive<A>::value,
void>
serialize(
const A& ar,
resT(*(&fn))(
paramT...)) {
974 std::enable_if_t<!is_default_serializable_v<Archive, resT(objT::*)(paramT...)>>> {
984 template <
typename A = Archive>
1001 std::enable_if_t<!is_default_serializable_v<Archive, resT(objT::*)(paramT...) const>>
1017 template <
class Archive,
class T>
1071 template <
class Archive,
class T, std::
size_t n>
1080 ar <<
wrap(&t[0],n);
1091 ar >>
wrap(&t[0],n);
1101 template <
class Archive,
typename T>
1109 ar &
c.real() &
c.imag();
1118 template <
class Archive,
typename T>
1128 c = std::complex<T>(r,i);
1136 template <
class Archive,
typename T>
1153 template <
class Archive,
typename T>
1168#if __cplusplus >= 202002L
1172 template <
class Archive>
1173 struct ArchiveStoreImpl<
Archive,
std::
atomic_flag, std::enable_if_t<is_serializable_v<Archive, bool>> > {
1178 static inline void store(
const Archive& ar, std::atomic_flag
v) {
1188 template <
class Archive>
1189 struct ArchiveLoadImpl<
Archive,
std::
atomic_flag, std::enable_if_t<is_serializable_v<Archive, bool>> > {
1194 static inline void load(
const Archive& ar, std::atomic_flag&
v) {
1212 template <
class Archive,
typename T>
1229 template <
class Archive,
typename T>
1245 template <
class Archive,
typename T,
typename Alloc>
1253 MAD_ARCHIVE_DEBUG(std::cout <<
"serialize std::vector of plain data" << std::endl);
1254 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1255 ar &
v.get_allocator();
1258 ar &
wrap(
v.data(),
v.size());
1268 template <
class Archive,
typename T,
typename Alloc>
1277 MAD_ARCHIVE_DEBUG(std::cout <<
"deserialize std::vector of plain data" << std::endl);
1278 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1283 std::size_t n = 0
ul;
1285 if (n !=
v.size()) {
1289 ar &
wrap((
T *)
v.data(),n);
1299 template <
class Archive,
typename Alloc>
1305 static inline void store(
const Archive& ar,
const std::vector<bool, Alloc>&
v) {
1307 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1308 ar &
v.get_allocator();
1310 std::size_t n =
v.size();
1311 bool*
b =
new bool[n];
1312 for (std::size_t i=0; i<n; ++i)
b[i] =
v[i];
1313 ar & n &
wrap(
b,
v.size());
1323 template <
class Archive,
typename Alloc>
1332 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1337 std::size_t n = 0
ul;
1339 if (n !=
v.size()) {
1343 bool*
b =
new bool[n];
1345 for (std::size_t i=0; i<n; ++i)
v[i] =
b[i];
1355 template <
class Archive,
typename T, std::
size_t N>
1363 MAD_ARCHIVE_DEBUG(std::cout <<
"serialize std::array<T," <<
N <<
">, with T plain data" << std::endl);
1365 ar &
wrap(
v.data(),
v.size());
1375 template <
class Archive,
typename T, std::
size_t N>
1383 MAD_ARCHIVE_DEBUG(std::cout <<
"deserialize std::array<T," <<
N <<
">, with T plain data" << std::endl);
1384 std::size_t n = 0
ul;
1387 ar &
wrap((
T *)
v.data(),n);
1395 template <
class Archive>
1404 ar &
wrap((
const char*)
v.data(),
v.size());
1412 template <
class Archive>
1421 std::size_t n = 0
ul;
1423 if (n !=
v.size()) {
1427 ar &
wrap((
char*)
v.data(),n);
1437 template <
class Archive,
typename T,
typename Q>
1445 ar & t.first & t.second;
1453 template <
class Archive,
typename T>
1471 t = std::move(value);
1480 struct tuple_serialize_helper;
1484 static void exec(
const Archive& ar, std::tuple<Types...>& t) {
1485 ar & std::get<0>(t);
1489 struct tuple_serialize_helper {
1490 static void exec(
const Archive& ar, std::tuple<Types...>& t) {
1491 ar & std::get<idx>(t);
1492 tuple_serialize_helper<idx-1,Archive,Types...>::exec(ar,t);
1510 constexpr auto size = std::tuple_size<std::tuple<
Types...>>::value;
1511 tuple_serialize_helper<size-1,Archive,Types...>::exec(ar, t);
1522 template <
class Archive,
typename T,
typename Q,
typename Compare,
typename Alloc>
1523 struct ArchiveStoreImpl<
Archive,
std::map<T,Q,Compare,Alloc>, std::enable_if_t<is_serializable_v<Archive, T> && is_serializable_v<Archive, Q>> > {
1528 static void store(
const Archive& ar,
const std::map<T,Q,Compare,Alloc>& t) {
1530 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1531 ar & t.get_allocator();
1534 for (
auto p = t.begin();
1535 p != t.end(); ++
p) {
1541 std::pair<T,Q>
pp = *
p;
1555 template <
class Archive,
typename T,
typename Q,
typename Compare,
typename Alloc>
1556 struct ArchiveLoadImpl<
Archive,
std::map<T,Q,Compare,Alloc>, std::enable_if_t<is_serializable_v<Archive, T> && is_serializable_v<Archive, Q>> > {
1564 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1567 t = std::map<T,Q,Compare,Alloc>(
allocator);
1576 t.emplace(std::move(
p.first), std::move(
p.second));
1588 template <
class Archive,
typename T,
typename Compare,
typename Alloc>
1595 static inline void store(
const Archive& ar,
const std::set<T, Compare, Alloc>& s) {
1597 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1598 ar & s.get_allocator();
1601 for (
const auto &i : s)
1613 template <
class Archive,
typename T,
typename Compare,
typename Alloc>
1621 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1624 s = std::set<T, Compare, Alloc>(
allocator);
1629 auto hint = s.begin();
1630 for (std::size_t i = 0; i < size; ++i)
1632 typename std::set<T, Compare, Alloc>::key_type key=0;
1634 hint = s.emplace_hint(
hint, std::move(key));
1646 template <
class Archive,
typename T,
typename Alloc>
1653 static inline void store(
const Archive& ar,
const std::list<T, Alloc>& s) {
1655 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1656 ar & s.get_allocator();
1659 for (
const auto &i : s)
1670 template <
class Archive,
typename T,
typename Alloc>
1678 if constexpr (!std::allocator_traits<Alloc>::is_always_equal::value) {
1686 for (std::size_t i = 0; i < size; ++i)
1690 s.emplace_back(std::move(
elem));
#define MAD_ARCHIVE_DEBUG(s)
Macro for helping debug archive tools.
Definition archive.h:77
Definition test_ar.cc:118
Base class for all archive classes.
Definition archive.h:359
std::false_type is_loading
Type used by Boost.Serialization to determine if this object is an input archive.
Definition archive.h:364
BaseArchive()
Definition archive.h:368
std::false_type is_saving
Type used by Boost.Serialization to determine if this object is an output archive.
Definition archive.h:365
static constexpr bool is_parallel_archive
Flag to determine if this object is a parallel archive.
Definition archive.h:366
Base class for output archive classes.
Definition archive.h:383
std::true_type is_saving
Type used by Boost.Serialization to determine if this object is an output archive.
Definition archive.h:386
Wrapper for dynamic arrays and pointers.
Definition archive.h:891
archive_array()
Constructor specifying no array and of 0 length.
Definition archive.h:903
unsigned int n
The number of objects in the array.
Definition archive.h:894
const T * ptr
The pointer.
Definition archive.h:893
archive_array(const T *ptr, unsigned int n)
Constructor specifying a memory location and size.
Definition archive.h:900
Wrapper for an opaque pointer for serialization purposes.
Definition archive.h:851
archive_ptr(T *t=nullptr)
Constructor specifying nullptr by default.
Definition archive.h:858
T * ptr
The pointer.
Definition archive.h:853
void serialize(const Archive &ar)
Serialize the pointer.
Definition archive.h:873
T & operator*()
Dereference the pointer.
Definition archive.h:864
char * p(char *buf, const char *name, int k, int initial_level, double thresh, int order)
Definition derivatives.cc:72
const std::size_t bufsize
Definition derivatives.cc:16
auto T(World &world, response_space &f) -> response_space
Definition global_functions.cc:28
archive_array< unsigned char > wrap_opaque(const T *, unsigned int)
Factory function to wrap a pointer to contiguous data as an opaque (uchar) archive_array.
Definition archive.h:926
const char * archive_type_names[256]
The list of type names for use in archives.
Definition archive_type_names.cc:46
archive_ptr< T > wrap_ptr(T *p)
Wrapper for pointers.
Definition archive.h:883
std::ptrdiff_t fn_ptr_origin()
Definition archive.cc:52
std::ptrdiff_t to_rel_fn_ptr(const T &fn)
converts function or (free or static member) function pointer to the relative function pointer
Definition archive.h:238
const char * get_type_name()
Returns the name of the type, or unknown if not registered.
Definition archive.h:125
std::enable_if_t< is_output_archive< Archive >::value &&is_default_serializable< Archive, T >::value &&is_function_pointer_v< T >, void > default_serialize(const Archive &ar, const T *t, unsigned int n)
Serialize an array of fundamental stuff.
Definition archive.h:403
T to_abs_fn_ptr(std::ptrdiff_t rel_fn_ptr)
converts relative free or static member function pointer to the absolute function pointer
Definition archive.h:315
archive_array< T > wrap(const T *, unsigned int)
Factory function to wrap a dynamically allocated pointer as a typed archive_array.
Definition archive.h:914
std::enable_if_t< is_input_archive_v< Archive >, const Archive & > operator>>(const Archive &ar, const T &t)
Redirect >> to ArchiveImpl::wrap_load for input archives.
Definition archive.h:790
auto to_rel_memfn_ptr(const T &fn)
converts nonstatic member function pointer to the relative equivalent
Definition archive.h:260
std::enable_if_t< is_output_archive_v< Archive >, const Archive & > operator<<(const Archive &ar, const T &t)
Redirect << to ArchiveImpl::wrap_store for output archives.
Definition archive.h:769
std::enable_if_t< is_output_archive_v< Archive >, const Archive & > operator&(const Archive &ar, const T &t)
Redirect & to ArchiveImpl::wrap_store for output archives.
Definition archive.h:811
auto to_abs_memfn_ptr(std::array< std::ptrdiff_t, N > rel_fn_ptr)
converts relative (nonstatic) member function pointer to the absolute function pointer
Definition archive.h:326
std::enable_if_t< ! is_default_serializable< Archive, T >::value &&is_archive< Archive >::value, void > serialize(const Archive &ar, const T *t, unsigned int n)
Serialize (or deserialize) an array of non-fundamental stuff.
Definition archive.h:498
#define ARCHIVE_REGISTER_TYPE_AND_PTR(T, cooky)
Used to associate a type and a pointer to the type with a cookie value inside archive.
Definition archive.h:146
void archive_initialize_type_names()
Initializes the type names for the archives.
Definition archive_type_names.cc:53
static const double v
Definition hatom_sf_dirac.cc:20
Defines madness::MadnessException for exception handling.
#define MADNESS_EXCEPTION(msg, value)
Macro for throwing a MADNESS exception.
Definition madness_exception.h:119
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
constexpr bool is_default_serializable_v
Definition type_traits.h:466
static XNonlinearSolver< std::vector< Function< T, NDIM > >, T, vector_function_allocator< T, NDIM > > nonlinear_vector_solver(World &world, const long nvec)
Definition nonlinsol.h:371
static const double b
Definition nonlinschro.cc:119
static const double c
Definition relops.cc:10
Definition hatom_sf_dirac.cc:91
static const Archive & wrap_load(const Archive &ar, const T(&t)[n])
Load the array, using the preamble and postamble to perform runtime type-checking.
Definition archive.h:1089
static const Archive & wrap_store(const Archive &ar, const T(&t)[n])
Store the array, wrapped by the preamble/postamble.
Definition archive.h:1078
static const Archive & wrap_load(const Archive &ar, const archive_array< T > &t)
Load the archive_array, using the preamble and postamble to perform runtime type-checking.
Definition archive.h:1045
static const Archive & wrap_store(const Archive &ar, const archive_array< T > &t)
Store the archive_array, wrapped by the preamble/postamble.
Definition archive.h:1024
Default implementations of wrap_store and wrap_load.
Definition archive.h:727
static const Archive & wrap_load(const Archive &ar, const T &t)
Load an object sandwiched between its preamble and postamble.
Definition archive.h:748
static const Archive & wrap_store(const Archive &ar, const T &t)
Store an object sandwiched between its preamble and postamble.
Definition archive.h:734
static void load(const Archive &ar, std::allocator< T > &v)
Loading a std::allocator is a no-op.
Definition archive.h:1236
static void load(const Archive &ar, std::array< T, N > &v)
Load a std::array.
Definition archive.h:1382
static void load(const Archive &ar, std::atomic< T > &v)
Load std::atomic<T> from archive.
Definition archive.h:1159
static void load(const Archive &ar, std::complex< T > &c)
Load a complex number.
Definition archive.h:1124
static void load(const Archive &ar, std::list< T, Alloc > &s)
Definition archive.h:1676
static void load(const Archive &ar, std::map< T, Q, Compare, Alloc > &t)
Load a map.
Definition archive.h:1562
static void load(const Archive &ar, std::set< T, Compare, Alloc > &s)
Definition archive.h:1619
static void load(const Archive &ar, std::string &v)
Load a string.
Definition archive.h:1419
static void load(const Archive &ar, std::vector< T, Alloc > &v)
Load a std::vector.
Definition archive.h:1276
static void load(const Archive &ar, std::vector< bool, Alloc > &v)
Load a vector<bool>.
Definition archive.h:1330
Default load of an object via serialize(ar, t).
Definition archive.h:667
static void load(const A &ar, const U &t)
Load an object.
Definition archive.h:679
static void load(const Archive &ar, U &t)
Load function reference stored as function pointer.
Definition archive.h:704
Default implementation of the pre/postamble for type checking.
Definition archive.h:510
static void preamble_load(const Archive &ar)
Deserialize a cookie and check the type.
Definition archive.h:514
static void postamble_store(const Archive &)
By default there is no postamble.
Definition archive.h:546
static void postamble_load(const Archive &)
By default there is no postamble.
Definition archive.h:543
static void preamble_store(const Archive &ar)
Serialize a cookie for type checking.
Definition archive.h:536
static void serialize(const A &ar, resT(*(&fn))(paramT...))
Serialize the function pointer.
Definition archive.h:953
static std::enable_if_t<!is_output_archive< A >::value, void > serialize(const A &ar, resT(*(&fn))(paramT...))
Definition archive.h:958
static void serialize(const Archive &ar, resT(objT::*memfn)(paramT...) const)
Serialize the const member function pointer.
Definition archive.h:1007
static void serialize(const A &ar, resT(objT::*(&memfn))(paramT...))
Serialize the member function pointer.
Definition archive.h:980
static std::enable_if_t<!is_output_archive< A >::value, void > serialize(const A &ar, resT(objT::*(&memfn))(paramT...))
Definition archive.h:985
static void serialize(const Archive &ar, std::optional< T > &t)
Serialize the std::optional.
Definition archive.h:1459
static void serialize(const Archive &ar, std::pair< T, Q > &t)
Serialize the pair.
Definition archive.h:1443
static void serialize(const Archive &ar, std::tuple< Types... > &t)
Serialize the std::tuple.
Definition archive.h:1508
Default symmetric serialization of a non-fundamental type that has serialize method.
Definition archive.h:555
static void serialize(const Archive &ar, T &t)
Serializes the type.
Definition archive.h:561
static void store(const Archive &ar, const std::allocator< T > &v)
Storing a std::allocator is a no-op.
Definition archive.h:1219
static void store(const Archive &ar, const std::array< T, N > &v)
Store a std::array.
Definition archive.h:1362
static void store(const Archive &ar, const std::atomic< T > &v)
Store std::atomic<T> to archive.
Definition archive.h:1142
static void store(const Archive &ar, const std::complex< T > &c)
Store a complex number.
Definition archive.h:1107
static void store(const Archive &ar, const std::list< T, Alloc > &s)
Store a std::list.
Definition archive.h:1653
static void store(const Archive &ar, const std::map< T, Q, Compare, Alloc > &t)
Store a map.
Definition archive.h:1528
static void store(const Archive &ar, const std::set< T, Compare, Alloc > &s)
Store a std::set.
Definition archive.h:1595
static void store(const Archive &ar, const std::string &v)
Store a string.
Definition archive.h:1401
static void store(const Archive &ar, const std::vector< T, Alloc > &v)
Store a std::vector of plain data.
Definition archive.h:1252
static void store(const Archive &ar, const std::vector< bool, Alloc > &v)
Store a vector<bool>.
Definition archive.h:1305
Default store of an object via serialize(ar, t).
Definition archive.h:612
static void store(const Archive &ar, const U &t)
Store function reference as a function pointer.
Definition archive.h:647
static std::enable_if_t< is_output_archive_v< A > &&!std::is_function< U >::value &&(has_member_serialize_v< U, A >||has_nonmember_serialize_v< U, A >||has_freestanding_serialize_v< U, A >||has_freestanding_default_serialize_v< U, A >), void > store(const A &ar, const U &t)
Definition archive.h:622
Used to enable type checking inside archives.
Definition archive.h:116
static const unsigned char cookie
Numeric ID for the type; 255 indicates unknown type.
Definition archive.h:117
Checks if T is an archive type.
Definition type_traits.h:506
is std::true_type if T can be serialized to Archive without specialized serialize() method
Definition type_traits.h:461
Checks if T is an output archive type.
Definition type_traits.h:539
#define N
Definition testconv.cc:37