Skip to content
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

Reenable span::_as_bytes() for MSVC > 1928 #277

Merged
merged 1 commit into from
Jun 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Vc/common/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,9 @@ template <typename T> class span<T, dynamic_extent>
}

#ifdef __cpp_lib_byte
// Disable _as_bytes() for MSVC as it leads to a compilation error due to a compiler bug.
// Disable _as_bytes() for older MSVC versions as it leads to a compilation error due to a compiler bug.
// When parsing the return type, MSVC will instantiate the primary template of span<> and static_assert().
// A bugreport has been submitted and the issue is supposedly fixed in VS 16.10. If so, we can replace the #ifndef by:
// #if _MSC_VER > 1928
#ifndef _MSC_VER
#if _MSC_VER > 1928
span<const std::byte, dynamic_extent> _as_bytes() const noexcept
{
return {reinterpret_cast<const std::byte*>(data()), size_bytes()};
Expand Down