make serialize a member function for null_type

This commit is contained in:
Hans Dembinski 2019-11-21 00:24:32 +01:00 committed by GitHub
parent e093ecd4b0
commit b1988cd75d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -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) {

View File

@ -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); });
}
};

View File

@ -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;

View File

@ -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;
}
};