mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-11 13:14:06 +00:00
make serialize a member function for null_type
This commit is contained in:
parent
e093ecd4b0
commit
b1988cd75d
@ -36,7 +36,7 @@ struct array_wrapper {
|
|||||||
std::size_t size;
|
std::size_t size;
|
||||||
|
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive& ar, unsigned) {
|
void serialize(Archive& ar, unsigned /* version */) {
|
||||||
static_if_c<(has_array_optimization<Archive>::value &&
|
static_if_c<(has_array_optimization<Archive>::value &&
|
||||||
std::is_trivially_copyable<T>::value)>(
|
std::is_trivially_copyable<T>::value)>(
|
||||||
[this](auto& ar) {
|
[this](auto& ar) {
|
||||||
|
@ -192,7 +192,7 @@ void axes_serialize(Archive& ar, std::tuple<Ts...>& axes) {
|
|||||||
// needed to keep serialization format backward compatible
|
// needed to keep serialization format backward compatible
|
||||||
struct proxy {
|
struct proxy {
|
||||||
std::tuple<Ts...>& t;
|
std::tuple<Ts...>& t;
|
||||||
void serialize(Archive& ar, unsigned) {
|
void serialize(Archive& ar, unsigned /* version */) {
|
||||||
mp11::tuple_for_each(t, [&ar](auto& x) { ar& make_nvp("item", x); });
|
mp11::tuple_for_each(t, [&ar](auto& x) { ar& make_nvp("item", x); });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -31,16 +31,16 @@ using index_type = int;
|
|||||||
using real_index_type = double;
|
using real_index_type = double;
|
||||||
|
|
||||||
/// Empty metadata type
|
/// Empty metadata type
|
||||||
struct null_type {};
|
struct null_type {
|
||||||
|
template <class Archive>
|
||||||
|
void serialize(Archive&, unsigned /* version */) {}
|
||||||
|
};
|
||||||
|
|
||||||
/// Another alias for an empty metadata type
|
/// Another alias for an empty metadata type
|
||||||
using empty_type = null_type;
|
using empty_type = null_type;
|
||||||
|
|
||||||
#ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
|
#ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
|
||||||
|
|
||||||
template <class Archive>
|
|
||||||
void serialize(Archive&, null_type&, unsigned /* version */) {}
|
|
||||||
|
|
||||||
namespace transform {
|
namespace transform {
|
||||||
struct id;
|
struct id;
|
||||||
struct log;
|
struct log;
|
||||||
|
@ -23,7 +23,7 @@ struct dummy_array_wrapper {
|
|||||||
T* ptr;
|
T* ptr;
|
||||||
std::size_t size;
|
std::size_t size;
|
||||||
template <class Archive>
|
template <class Archive>
|
||||||
void serialize(Archive& ar, unsigned) {
|
void serialize(Archive& ar, unsigned /* version */) {
|
||||||
for (auto&& x : dtl::make_span(ptr, size)) ar& x;
|
for (auto&& x : dtl::make_span(ptr, size)) ar& x;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user