Closed filcuc closed 4 years ago
arm-poky-linux-gnueabi-g++ (GCC) 6.3.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#include <iostream>
#include <boost/pfr.hpp>
#include <experimental/optional>
struct Test {
std::experimental::optional<int> value;
};
int main() {
Test test;
boost::pfr::for_each_field(test, [](const auto& v) {});
return 0;
}
Instead of supporting std::optional specifically, would it be possible to enable a more generic extension of the serialization mechanism?
For example we can register a function to handle some specific type (optional
Instead of supporting std::optional specifically, would it be possible to enable a more generic extension of the serialization mechanism?
Unfortunately that won't help with the optional
case case.
The only way to deal with the issue is to upgrade to the C++17 standard.
I've described the limitations of C++14 more precisely in the docs: http://apolukhin.github.io/magic_get/boost_pfr/limitations.html
Alas, that's the only known solution to the problem.
It seems that std::experimental::optional (c++14) or std::optional(c++17) are not supported