mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-09 23:04:07 +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;
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, unsigned) {
|
||||
void serialize(Archive& ar, unsigned /* version */) {
|
||||
static_if_c<(has_array_optimization<Archive>::value &&
|
||||
std::is_trivially_copyable<T>::value)>(
|
||||
[this](auto& ar) {
|
||||
|
@ -192,7 +192,7 @@ void axes_serialize(Archive& ar, std::tuple<Ts...>& axes) {
|
||||
// needed to keep serialization format backward compatible
|
||||
struct proxy {
|
||||
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); });
|
||||
}
|
||||
};
|
||||
|
@ -31,16 +31,16 @@ using index_type = int;
|
||||
using real_index_type = double;
|
||||
|
||||
/// Empty metadata type
|
||||
struct null_type {};
|
||||
struct null_type {
|
||||
template <class Archive>
|
||||
void serialize(Archive&, unsigned /* version */) {}
|
||||
};
|
||||
|
||||
/// Another alias for an empty metadata type
|
||||
using empty_type = null_type;
|
||||
|
||||
#ifndef BOOST_HISTOGRAM_DOXYGEN_INVOKED
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive&, null_type&, unsigned /* version */) {}
|
||||
|
||||
namespace transform {
|
||||
struct id;
|
||||
struct log;
|
||||
|
@ -23,7 +23,7 @@ struct dummy_array_wrapper {
|
||||
T* ptr;
|
||||
std::size_t size;
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, unsigned) {
|
||||
void serialize(Archive& ar, unsigned /* version */) {
|
||||
for (auto&& x : dtl::make_span(ptr, size)) ar& x;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user