From 1b178a5735c08ad299641210421f5e1f2557cbd6 Mon Sep 17 00:00:00 2001 From: Ibraim Ganiev Date: Mon, 11 Apr 2022 21:52:25 +0300 Subject: [PATCH] Serialized and deserialized types must match In our project at work we use custom boost archive for serialization and deserialization, and unsigned integers are serialized in a non-trivial way, which does not match with serialization of signed integer. This causes some troubles. I guess it is fine to change this serialization method in upstream project. --- include/boost/graph/adj_list_serialize.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/graph/adj_list_serialize.hpp b/include/boost/graph/adj_list_serialize.hpp index 85f7e2ed4..830fd8a26 100644 --- a/include/boost/graph/adj_list_serialize.hpp +++ b/include/boost/graph/adj_list_serialize.hpp @@ -46,8 +46,8 @@ namespace serialization typedef adjacency_list< OEL, VL, D, VP, EP, GP, EL > Graph; typedef typename graph_traits< Graph >::vertex_descriptor Vertex; - int V = num_vertices(graph); - int E = num_edges(graph); + unsigned int V = num_vertices(graph); + unsigned int E = num_edges(graph); ar << BOOST_SERIALIZATION_NVP(V); ar << BOOST_SERIALIZATION_NVP(E);