-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
Hello all,
is it possible to have support for std::filesystem::path serialization? There were old discussions about boost::filesystem::path:
- http://lists.boost.org/Archives/boost/2008/09/142550.php
- https://svn.boost.org/trac/boost/ticket/5192
Implementation inspired by John Rade's answer would be something like this:
namespace boost
{
namespace serialization
{
template <class Archive>
void serialize(Archive& ar, std::filesystem::path& rpth, const unsigned int)
{
std::string str;
BOOST_IF_CONSTEXPR (Archive::is_saving::value)
{
str = rpth;
}
ar & boost::serialization::make_nvp("path", str);
BOOST_IF_CONSTEXPR (Archive::is_loading::value)
{
rpth = std::move(str);
}
}
}
}
Probably someone who knows the library would come up with a better implementation.
Metadata
Metadata
Assignees
Labels
No labels