File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,11 @@ template <typename T> class span<T, dynamic_extent>
518518 }
519519
520520#ifdef __cpp_lib_byte
521+ // Disable _as_bytes() for MSVC as it leads to a compilation error due to a compiler bug.
522+ // When parsing the return type, MSVC will instantiate the primary template of span<> and static_assert().
523+ // A bugreport has been submitted and the issue is supposedly fixed in VS 16.10. If so, we can replace the #ifndef by:
524+ // #if _MSC_VER > 1928
525+ #ifndef _MSC_VER
521526 span<const std::byte, dynamic_extent> _as_bytes () const noexcept
522527 {
523528 return {reinterpret_cast <const std::byte*>(data ()), size_bytes ()};
@@ -527,6 +532,7 @@ template <typename T> class span<T, dynamic_extent>
527532 {
528533 return {reinterpret_cast <std::byte*>(data ()), size_bytes ()};
529534 }
535+ #endif
530536#endif // __cpp_lib_byte
531537
532538private:
You can’t perform that action at this time.
0 commit comments