Fix MSVC warnings and compile errors #601
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
warning STL4038: The contents of <expected> are available only with C++23 or later.
sl.cpp(15,19): error C3688: invalid literal suffix '_i'; literal operator or literal operator template 'operator ""_i' not found
ut.cpp(93,5): error C7595: 'std::source_location::current': call to immediate function is not a constant expression
std::max
clashes withWindows.h
max()
macro.Solution:
#ifdef __cpp_lib_expected
instead of__has_include(<expected>)
, the latter isn't reliable.ut.hpp
is compatible withWindows.h
(push & popmin
&max
).Note that we also need #592 for the build to pass (after the rename from
is_container_v
tois_range_v
).Also there are still 7 of the unit tests (
ut.cpp
) that fails (#600) which is the case for MSVC as well.Issue: #579
Reviewers:
@kris-jusiak