stdgraph / graph-v2

General-purpose C++ graph library
https://stdgraph.github.io/graph-v2/
Boost Software License 1.0
192 stars 20 forks source link

Missing `std::_Fake_copy_init` in MSVC build #89

Open akrzemi1 opened 9 months ago

akrzemi1 commented 9 months ago

I am using Microsoft Visual C++ 2022, version 17.3.4, both std C++20, and the experimental newest C++.

The compilation of std::graph::views::edges_breadth_first_search fails with an error that std::_Fake_copy_init is not defined. Removing this #ifndef guard fixes the problem. I can see that other STL implementations (like this one) do have it defined.

Maybe to enable thecompilation on any MSVC build this library should define its own type std::graph::fake_copy_init independent of the compiler used.

pratzl commented 1 month ago

Thanks for your comment. I'll consider your recommendation. I'm not sure why you're running into a problem because I've been using the latest MSVC all along. I know it's been a while since you reported this. Do you know if you're still running into the issue?

akrzemi1 commented 1 month ago

I confirm that the bug still persists in branch master as of today: 3d572ef49de7526d0152b63dba466f1ca51f5d4b

I am using the same version of MSVC as in the initial report.

The error message is for this like: https://github.com/stdgraph/graph-v2/blob/master/include/graph/detail/graph_cpo.hpp#L13

My single-file test project includes two graph headers in this order:

#include <iostream>
#include <string>
#include <vector>
#include <graph/views/breadth_first_search.hpp>
#include <graph/graph.hpp>
pratzl commented 1 month ago

I'll work on getting a fix in, hopefully before I go on break next week.

Sent from Outlookhttp://aka.ms/weboutlook From: Andrzej Krzemieński @.> Sent: Friday, September 13, 2024 1:31 AM To: stdgraph/graph-v2 @.> Cc: Phil Ratzloff @.>; Comment @.> Subject: Re: [stdgraph/graph-v2] Missing std::_Fake_copy_init in MSVC build (Issue #89)

I confirm that the bug still persists in branch master as of today: 3d572efhttps://github.com/stdgraph/graph-v2/commit/3d572ef49de7526d0152b63dba466f1ca51f5d4b

I am using the same version of MSVC as in the initial report.

The error message is for this like: https://github.com/stdgraph/graph-v2/blob/master/include/graph/detail/graph_cpo.hpp#L13

My single-file test project includes two graph headers in this order:

include

include

include

include <graph/views/breadth_first_search.hpp>

include <graph/graph.hpp>

- Reply to this email directly, view it on GitHubhttps://github.com/stdgraph/graph-v2/issues/89#issuecomment-2348063960, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7NKERVG7OZV7R6SXTY6PLZWJ2ADAVCNFSM6AAAAABOEMQJU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBYGA3DGOJWGA. You are receiving this because you commented.Message ID: @.**@.>>

pratzl commented 1 month ago

I'll create an independent set of definitions outside of MSVC & gcc, as you suggest. I'll try to get it in later this week.

pratzl commented 1 month ago

I've pushed a fix. I'd appreciate it if you could let me know whether it works for you or not.