-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile with Emscripten: incorrect forward declaration for std::vector
#51
Comments
Thanks for reporting. Yes, the existing If it matters, the current approach is meant to address a somewhat contradictory situation:
Hence this |
No worries! I haven't been in the shoes of one of these compile speed zealots yet, so it seems to me like a high maintenance price to pay to save a few milliseconds :) But I understand everyone's needs are different! And it's your maintenance time, not mine ;) In this instance, perhaps a fallback to include |
Thank you for merging the PR! Do you think you could upgrade the c4core version used by rapidyaml? Then I can get rid of my forks :) |
The file
vector_fwd.hpp
attempts to forward-declarestd::vector
, and uses compiler-specific ifdefs to specify the exact namespace insidestd::
. This currently does not work with Emscripten, which uses it's own version of libc++. Apparently, they use thestd::__2
namespace, and notstd::__1
, which is what c4core currently assumes for libc++.This can currently be fixed by modifying the code to:
An alternative, perhaps cleaner way, is to just use
_LIBCPP_BEGIN_NAMESPACE_STD
and_LIBCPP_END_NAMESPACE_STD
?But none of this is very stable/portable. I'm not sure this is worth the trouble, since
<vector>
will have to be included to actually use any of the functions declared in this header.The text was updated successfully, but these errors were encountered: