You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running in a compilation failure on 32bit platforms for the shortest-paths.cxx test. The symptoms are the following:
/home/bluescarni/repos/graph/include/andres/graph/shortest-paths.hxx:1542:22: error: lvalue required as left operand of assignment distances[v] = infinity; ~~~~~~~~~~~~~^~~~~~~~~~/home/bluescarni/repos/graph/include/andres/graph/shortest-paths.hxx:1547:19: error: lvalue required as left operand of assignment distances[vs] = 0; ~~~~~~~~~~~~~~^~~/home/bluescarni/repos/graph/include/andres/graph/shortest-paths.hxx:1565:45: error: lvalue required as left operand of assignment distances[it->vertex()] = alternativeDistance; ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
The problem seems to be that, on some 32bit platforms, std::size_t and unsigned are the same type. What happens then is that this call:
DISTANCE_ITERATOR is of type UnitEdgeValueIterator, and the line distances[v] = infinity; fails because distances[v] yields a value rather than a reference.
The issue can be reproduced on 32bit build on MSVC, clang and gcc.
The text was updated successfully, but these errors were encountered:
I am running in a compilation failure on 32bit platforms for the
shortest-paths.cxx
test. The symptoms are the following:The problem seems to be that, on some 32bit platforms,
std::size_t
andunsigned
are the same type. What happens then is that this call:https://github.com/bjoern-andres/graph/blob/master/include/andres/graph/shortest-paths.hxx#L1364
resolves to this function (on 32bit platforms)
https://github.com/bjoern-andres/graph/blob/master/include/andres/graph/shortest-paths.hxx#L1376
rather than this:
https://github.com/bjoern-andres/graph/blob/master/include/andres/graph/shortest-paths.hxx#L1448
So when the flow finally gets inside this function:
https://github.com/bjoern-andres/graph/blob/master/include/andres/graph/shortest-paths.hxx#L1516
DISTANCE_ITERATOR
is of typeUnitEdgeValueIterator
, and the linedistances[v] = infinity;
fails becausedistances[v]
yields a value rather than a reference.The issue can be reproduced on 32bit build on MSVC, clang and gcc.
The text was updated successfully, but these errors were encountered: