Created
March 20, 2020 22:14
-
-
Save hkaiser/e7eb766330ef01c716314f5c6d1a2a00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2020 Yorlik | |
// | |
// SPDX-License-Identifier: BSL-1.0 | |
// Distributed under the Boost Software License, Version 1.0. (See accompanying | |
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
#include <hpx/hpx.hpp> | |
#include <hpx/hpx_main.hpp> | |
#include <hpx/serialization.hpp> | |
#include <variant> | |
struct thing | |
{ | |
std::variant<int, double, std::string> v; | |
std::variant<std::string, double, int64_t> w; | |
template <typename Archive> | |
void serialize(Archive& ar, unsigned version) | |
{ | |
// clang-format off | |
ar & v; | |
ar & w; | |
// clang-format on | |
} | |
}; | |
int main(int argc, char* argv[]) | |
{ | |
std::vector<std::byte> cont; | |
hpx::serialization::output_archive ar(cont); | |
thing X; | |
ar << X; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment