graph-v2 icon indicating copy to clipboard operation
graph-v2 copied to clipboard

Header `shortest_paths.hpp` adds dependency on `fmt/format.h`

Open akrzemi1 opened this issue 2 years ago • 3 comments

This library should not depend on fmt/format.h, especially that on MSVC there is no reason to include it when we have <format>.

akrzemi1 avatar Jan 21 '24 20:01 akrzemi1

I chose to use a recent version of fmt to provide the latest capabilities in the library, as they continue to improve it, without requiring us to bump graph-v2 to use C++23. print() and println() are obvious things, but there are other features I can't recall off the top of my head. Is this causing you any problems?

pratzl avatar Sep 13 '24 01:09 pratzl

In my environment, I do not have the {fmt} library. That this should perevent me from doing the Shortest Paths algorithm is strange.

I tried to see if this is still the case, but I can see that the file shortest_paths.hpp is gone. I tried graph/algorithm/common_shortest_paths.hpp, but only through including it, I get error C2760 at line: https://github.com/stdgraph/graph-v2/blob/master/include/graph/algorithm/common_shortest_paths.hpp#L18

This is about the undefined identifier is_arithmetic_v, and a bunch of other identifiers in this file (like edge_reference_t). It looks like they require the namespace prefix.

akrzemi1 avatar Sep 13 '24 05:09 akrzemi1

CMake should be downloading the {fmt} library if you "Delete Cache and Reconfigure". There's now dijkstra_shortest_paths.hpp and bellman_ford_shortest_paths. This is similar to how Boost Graph does these algorithms. In the move from std::graph to the graph namespace, I added the using statements in graph_using.hpp to make things look cleaner. I don't know if this is the best idea, but I find it improves readability for myself. I've added an #include for that in common_shortest_paths.hpp so people won't get that error. It will be in the next push, hopefully this week.

pratzl avatar Sep 14 '24 17:09 pratzl