mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Added basic compile support for MSVC 2013 to byte.
This commit is contained in:
parent
267472449c
commit
8855c59579
@ -19,6 +19,23 @@
|
||||
#ifndef GSL_BYTE_H
|
||||
#define GSL_BYTE_H
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
// MSVC 2013 workarounds
|
||||
#if _MSC_VER <= 1800
|
||||
|
||||
// constexpr is not understood
|
||||
#pragma push_macro("constexpr")
|
||||
#define constexpr
|
||||
|
||||
// noexcept is not understood
|
||||
#pragma push_macro("noexcept")
|
||||
#define noexcept
|
||||
|
||||
#endif // _MSC_VER <= 1800
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
namespace gsl
|
||||
{
|
||||
// This is a simple definition for now that allows
|
||||
@ -68,4 +85,19 @@ namespace gsl
|
||||
|
||||
} // namespace gsl
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
#if _MSC_VER <= 1800
|
||||
|
||||
#undef constexpr
|
||||
#pragma pop_macro("constexpr")
|
||||
|
||||
#undef noexcept
|
||||
#pragma pop_macro("noexcept")
|
||||
|
||||
#endif // _MSC_VER <= 1800
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
#endif // GSL_BYTE_H
|
@ -87,6 +87,7 @@ SUITE(byte_tests)
|
||||
CHECK(a == byte(0x0F));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int main(int, const char* []) { return UnitTest::RunAllTests(); }
|
||||
|
@ -794,6 +794,15 @@ SUITE(span_tests)
|
||||
CHECK(it1 == it2);
|
||||
}
|
||||
|
||||
TEST(const_iterator)
|
||||
{
|
||||
span<int>::const_iterator it1;
|
||||
span<int>::const_iterator it2;
|
||||
CHECK(it1 == it2);
|
||||
|
||||
|
||||
}
|
||||
|
||||
TEST(begin_end)
|
||||
{
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user