Open Levi-Armstrong opened 3 years ago
After trying multiple different things I found a solution to allow it to build on windows. Switching the OutEdgeListS
from boost::listS
to boost::hash_mapS
solved the issues. The reason I tried this is because the last error stated it that list_tag
could not be converted to associative_container_tag
and after looking through the boost code I noticed that it listS
tag did not derive from associative_container_tag
but hash_mapS
did. So the question I have is should listS
work or is it truly not a valid type for the bidirectiona graph?
before:
using Graph = boost::adjacency_list<boost::listS, boost::listS, boost::bidirectionalS, VertexProperty, EdgeProperty, GraphProperty>;
After:
using Graph = boost:: adjacency_list<boost::hash_mapS, boost::listS, boost::bidirectionalS, VertexProperty, EdgeProperty, GraphProperty>;
I'm not familiar with building on Windows, though if it works with GCC and Clang it could be a bug in the MS compiler. For those that may be able to answer more concretely, it may be helpful with the specific Boost version and compiler version you are trying.
I don't think switching the out-edge list container should not be done lightly. They offer different guarantees that the rest of the code may rely on. E.g., if I remember correctly, then listS
means you have iterator stability during additions/deletions, while hash_mapS
does not. On the other hand, hash_mapS
gives access to the edge_range
function.
I'm not familiar with building on Windows, though if it works with GCC and Clang it could be a bug in the MS compiler. For those that may be able to answer more concretely, it may be helpful with the specific Boost version and compiler version you are trying.
I will try out clang compiler on linux and see if there are any issues. The other requested information is below.
I don't think switching the out-edge list container should not be done lightly. They offer different guarantees that the rest of the code may rely on. E.g., if I remember correctly, then
listS
means you have iterator stability during additions/deletions, whilehash_mapS
does not. On the other hand,hash_mapS
gives access to theedge_range
function.
Thanks for the information. I agree and currently the code is not functional because of the issue you stated related to the iterator stability when using hash_mapS.
I have also created this repository to isolate the code for those to test.
Hello,
I am currently in the process of getting an existing code base which builds fine on linux to build windows and I have ran into an issues with a section of code which leverages boost graph. I have also attached an example file which is almost an exact copy from here header and source. I need help understanding why it builds fine on Ubuntu but not on Windows; does anyone have any ideas to what might be the issue?
Compiler Explorer C++ Editor #1 Code (3).txt