Closed tchaikov closed 11 months ago
@jbeder hi Jesse, could you please help review this change at your convenience?
@jbeder hello Jesse, ping for reviews.
Can you sync to head so it can run the tests? Otherwise LGTM.
@jbeder sure. thank you for your review! rebased and repushed.
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
ERROR: D:/a/yaml-cpp/yaml-cpp/BUILD.bazel:14:11: Compiling src/binary.cpp failed: (Exit 1): vc_installation_error_x64.bat failed: error executing command (from target //:yaml-cpp) external\local_config_cc\vc_installation_error_x64.bat /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 ... (remaining 20 arguments skipped)
The target you are compiling requires Visual C++ build tools.
Bazel couldn't find a valid Visual C++ build tools installation on your machine.
Visual C++ build tools seems to be installed at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC
But Bazel can't find the following tools:
VCVARSALL.BAT, cl.exe, link.exe, lib.exe, ml64.exe
for x64 target architecture
Please check your installation following https://bazel.build/docs/windows#using
my guess is that this failure is an occurrence of https://github.com/bazelbuild/bazel/issues/18592 .
Yeah, I think you're right. Bad timing :)
It looks like they're working on a fix, so once they release it, we can rerun and then I'll merge this PR. (I hesitate to merge it with a broken test even if it's almost certainly unrelated.)
sure. let's keep an eye on the update on this bazel issue!
@jbeder hi Jesse, it seems that https://github.com/bazelbuild/bazel/issues/18592 has been fixed. could you please give a green light to the workflow, so we can verify the change?
Thanks for your work, but I found an issue after upgrading to 0.8.0.
MSVC initializes __cplusplus
with a value of 199711L
, if users don't specify the option Zc:__cplusplus
explicitly. As a result, your template specialization is disabled by default on Windows. I wonder whether it would be better to use the feature-test macro __cpp_lib_string_view` instead. What's your opinions? @tchaikov @jbeder
#if __cpp_lib_string_view >= 201606L
// ...
#endif
__cpp_lib_string_view
@0xFireWolf indeed. but instead of assuming the existence of __cpp_lib_string_view
, i'd prefer checking its existence instead, see #1222
Thanks for your work, but I found an issue after upgrading to 0.8.0.
MSVC initializes
__cplusplus
with a value of199711L
, if users don't specify the optionZc:__cplusplus
explicitly. As a result, your template specialization is disabled by default on Windows. I wonder whether it would be better to use the feature-test macro __cpp_lib_string_view` instead. What's your opinions? @tchaikov @jbeder#if __cpp_lib_string_view >= 201606L // ... #endif
@0xFireWolf yaml-cpp 0.6.0 and up requires C++11 and up. i don't think we are able to use C++98 with the master HEAD. how do you test yaml-cpp in your project?
How do you test yaml-cpp in your project?
@tchaikov My project uses C++20 and is compiled by GCC 10+, Clang 13+, and VS2019+.
@0xFireWolf so why do you care about C++standard of 199711L
?
Shall we keep the conversation in one place?
yeah. ahh, but kind of late. agreed, we should have used an issue for the discussion. but i am fine either place: here or https://github.com/jbeder/yaml-cpp/pull/1222 .
as the key is not always nul terminated, it'd be handy to use a
std::string_view
when a key is expected.before this change, we would have FTBFS if the key is a
string_view
when looking up a node in a map:after this change, a full specialization for
convert<std::string_view
is added so that we can lookup a node using key ofstd::string_view
, liketested with
Signed-off-by: Kefu Chai tchaikov@gmail.com