fix: [imp] VS2015 error C2610

This commit is contained in:
mutouyun 2022-10-16 21:40:54 +08:00
parent 3a3168b6f4
commit 595c1e4112
2 changed files with 10 additions and 4 deletions

View File

@ -38,9 +38,12 @@
// Compiler
#if defined(_MSC_VER)
# define LIBIMP_CC_MSVC
# define LIBIMP_CC_MSVC _MSC_VER
# define LIBIMP_CC_MSVC_2015 1900
# define LIBIMP_CC_MSVC_2017 1910
# define LIBIMP_CC_MSVC_2019 1920
#elif defined(__GNUC__)
# define LIBIMP_CC_GNUC
# define LIBIMP_CC_GNUC __GNUC__
#else
# error "This compiler is unsupported."
#endif

View File

@ -91,7 +91,10 @@ private:
public:
constexpr span() noexcept = default;
constexpr span(span const &) noexcept = default;
constexpr span & operator=(span const &) noexcept = default;
#if (LIBIMP_CC_MSVC > LIBIMP_CC_MSVC_2015)
constexpr
#endif
span & operator=(span const &) noexcept = default;
template <typename It,
typename = detail::is_compatible_iter<T, It>>
@ -128,7 +131,7 @@ public:
: ptr_ (s.data())
, extent_(s.size()) {}
#ifdef LIBIMP_CPP_20
#if defined(LIBIMP_CPP_20) || defined(__cpp_lib_span)
template <typename U, std::size_t E,
typename = detail::is_array_convertible<U, T>>
constexpr span(std::span<U, E> const &s) noexcept