Skip to content

Conversation

@f-michaut
Copy link

Adding std::filesystem::path support in cereal.

Relying on the current std::string serialization since it is the underling storage for filesystem::path.

@AzothAmmo
Copy link
Contributor

This looks pretty good, it needs a unit test like the other types, and that unit test should be properly gated behind C++17 conditionals like similar features.

@AzothAmmo AzothAmmo added this to the v1.3.3 milestone Jan 17, 2024
@f-michaut f-michaut force-pushed the filesystem-path-support branch from 203ba6f to 72c5e26 Compare August 6, 2025 16:47
@f-michaut f-michaut force-pushed the filesystem-path-support branch from 72c5e26 to 83cb386 Compare August 6, 2025 17:15
@f-michaut
Copy link
Author

Hi there, sorry for the small delay on this PR lol

I have added the required tests, however it's failing for XMLInputArchive and JSONInputArchive and I dont understand why.

Error message :

error: static assertion failed due to requirement 'traits::detail::count_input_serializers<std::filesystem::path, cereal::JSONInputArchive>::value != 0': cereal could not find any input serialization functions for the provided type and archive combination.

Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). 

Which I'm not sure I follow, because obviously I defined both save/load pair and its working fine for the Binary archives, and furthermore I looked at the save/load functions of the std::string type and they are identical to mine.

However the string type seems to be able to run tests on Json + XML archives without a problem...

Could you help me figure out why its not working ?

@f-michaut
Copy link
Author

f-michaut commented Aug 6, 2025

Also, small note that there was a few compilations errors in files unrelated to mines, but I fixed them regardless (in details/helpers.hpp and types/tuple.hpp).

You might want to double-check theses fixes, just to be sure. Tests are all passing, so I'm assuming its fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants